Article Title: Windows error 2 occurs while loading the Java VM
Article Name: WINDOWS3
OS Platforms: Windows
Last Updated: 10/20/2015

TOPIC:

This Tech Tip explains how to solve a problem where the RiverTools 4.0 installer does not complete the installation on Windows platforms that have Java VM version 1.8.0_60 installed.

DISCUSSION:

The RiverTools 4.0 installer was built using InstallAnywhere 2012, a Java-based, industry-standard program from Flexera for creating cross-platform installers. The installer first checks whether a Java Virtual Machine (VM), also called a Java Runtime Environment (RE), is available on the target computer. If not, it uses a Java VM that was bundled with the installer, version 1.7. However, there is a bug in InstallAnywhere 2012 that prevents it from working correctly with the Java VM version 1.8.0_60. This is due to a change in how the Java VM file version is formatted, using a 3-digit number (e.g. 600) for Update 60 instead of a 2-digit number (e.g. 51), used in all prior versions of Java. Because of this, necessary paths are built incorrectly and necessary files are not found. This results in the following error message after the installer finishes its "preparing to install" phase:


A variation of this problem is further documented on Flexera's website at:
Installer Fails to Launch Using Java 8 Update 60 on Windows.

There are a couple of work-arounds for resolving this problem. The first, and easiest, is to temporarily remove "javapath" from the Windows system environment variable called "PATH". This will prevent the installer from finding a Java VM on the target computer so that it will instead use the bundled Java VM, version 1.7. This can be done as follows:

Step 1: Start Windows using an account that has Administrator privileges.

Step 2: Open the Windows Control Panel. There are many different ways to do this, depending on whether you are using Windows 7 or Windows 8 and which mode. On Windows 8, moving your mouse cursor to the upper-right corner causes icons to appear on the right side of the screen. You can then click on the Search button (a magnifying glass), make sure Apps is selected, type control panel in the text box, then click on the Control Panel icon that appears. On Windows 7, click in the lower-left corner of the screen, then type control panel in the text box that is labeled Search programs and files.

Step 3: In the Control Panel, choose System and Security, then choose System. Next click on Advanced System Settings on the left side of the dialog to open the System Properties dialog, with the Advanced tab selected. At the bottom right of this dialog, click on the button labeled: Environment Variables....

Step 4: In the bottom half of the dialog, there is a table labeled System variables. Move the slider down until you see Path in the Variable column. Click on this row to select it, then click on the button below the table labeled Edit.... A small dialog with the title Edit System Variable will appear.

Step 5: Left click inside the text box labeled Variable value and drag to the left until you reach the first entry in the path. Entries are separated by a semicolon. Carefully select the entry: C:\ProgramData\Oracle\Java\javapath;, making sure to get the semicolon at the end. It is often the first entry, but may occur anywhere in the path. Once selected and highlighted, click the Delete button on your keyboard to remove this entry from the path.

Note: The Windows folder C:\ProgramData is hidden by default. If you open the C drive to view files with Explorer, then click on View at the top and check the box labeled Hidden items, the folder ProgramData will become visible. The folder C:\ProgramData\Oracle\Java\javapath contains symlinks to the Java executables. You can right click on these and choose Properties to see what executables they link to.

Step 6: Click on the OK button in the Edit System Variable dialog, then click OK in the Environment Variables dialog, then click OK in the System Properties dialog.

Step 7: Find the RiverTools 4.0 installer file, typically on your Desktop or in your Downloads folder, called install_win64.exe. Double-click on it to launch the installer. The installer should now function normally. If not, restart your computer and try again.

Step 8: After you have successfully installed RiverTools 4.0, reverse the steps above to add the entry C:\ProgramData\Oracle\Java\javapath; back into the PATH variable. Be sure to include the trailing semicolon. If you don't complete this final step, any other apps that require Java may not function properly.

Note that on Windows, some versions of the Java VM, also install executables such as java.exe (or symlinks to them) in the folder: C:\Windows\System32. In our tests, we found that Java version 1.7 does this but version 1.8 does not. It is therefore possible that the wrong version of Java will still be found even after javapath is removed from the PATH variable.

Another Option

If your computer has JRE version 1.7 installed in addition to version 1.8.0_60, then you can tell the installer to use this version instead. If version 1.7 is installed, you will find a folder called jre7 in the folder C:\Program Files\Java. If found, you can open a command prompt (run "cmd.exe"), then change to the directory that contains the RiverTools 4.0 installer file, install_win64.exe using cd. You can then type the following command at the prompt:

        install_win64.exe LAX_VM "C:\Program Files\Java\jre7\bin\java.exe"

If you prefer this option but don't have JRE version 1.7, you can download the installer for JRE version 1.7 (also called version 7) from Oracle at: Java SE 7 Archive Downloads. Unfortunately, you need to set up a free Oracle account before you can download older versions. Once you do that, and confirm the account via the email they send you, you can scroll down to the section of the page called Java SE Runtime Environment 7u79 and download the file jre-7u79-windows-x64.exe. After running it, you will have jre7 as well as jre1.8.0_60 folders in C:\Program Files\Java. You can then run the installer at a command prompt as explained above.


If you have any additional questions or comments, please contact Rivix Technical Support for assistance.

Copyright (C) RIVIX, LLC. 1998-2021