Summary:

On a recently reinstalled copy of Sage CRM, the exporting of reports to PDF and Mail Merge features were not working.

On attempting a mail merge, the following error message was displayed:

failed to create JVM Instance

Resolution

1) First, the Java CLASSPATH was set:

Windows XP

Select Start, select Control Panel. Double-click System, and select the Advanced tab.
Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Windows Vista:

From the desktop, right click the My Computer icon.
Choose Properties from the context menu.
Click the Advanced tab (Advanced system settings link in Vista).
Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Windows 7:

From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
 

Once this is complete, check the mail merge memory value in CRM.

1) Admin -> Documents and Reports Config. Report generator maximum memory (MB) should be set to below 1500MB (v7.1) or 1150MB (v7.2).
2) Restart the CRM Tomcat service via the Windows Services control panel (Start -> Run -> services.msc).