The “Windows Error 2 Occurred While Loading the Java VM” error is typically encountered when the user tries to launch the Launch Anywhere software and a few other programs that require a username and password in order to run. It seems like all programs that are causing this issue are using the same backend as the Launch Anywhere software.
After investigating this issue, it turns out that the issue is triggered by a change in the JAVA.exe internal build. Starting with Java 18.104.22.168, Java is reporting the internal build as 600, instead of 60 like it did in earlier versions. The Install Anywhere installer and other similar software might not be updated to recognize the new format that Java is currently using, hence the “Windows Error 2 Occurred While Loading the Java VM” error.
If you’re currently struggling with this issue, you’d be pleased to know we managed to identify a few fixes that have been extremely helpful for a lot of users in a similar situation as you. Please follow each potential fix in order until you encounter a method that resolves your situation. Let’s begin!
Method 1: Use the latest updates available
This issue is almost three years old, so you can probably assume that a lot of compatibility problems were already solved by the involved parties. Although the other methods below most likely resolve the issue, they all require a certain degree of technicality.
You can probably avoid getting your hands dirty by making sure you are using the latest Java release and the latest installer version. Java will automatically prompt you on every Windows version when it needs to update. But just in case you ignored those prompts, you can update to the latest version using this link (here).
Once the newest version is installed, reboot your computer and make sure you have the latest version of the installer that is showing the “Windows Error 2 Occurred While Loading the Java VM” error. If you had the installation executable in your computer for a while, go online and download the latest available version of the software that you’re trying to install. This should ensure that you take advantage of the latest compatibility fixes that were issued by the involved developers.
If you’re still seeing the “Windows Error 2 Occurred While Loading the Java VM” error when you open the installer, proceed to download and install the older version of Java instead of the newer one and check if your error is fixed.
Method 2: Launch the installer with the LAX_VM parameter
This method is widely regarded as the best fix for this type of problem. You can avoid the “Windows Error 2 Occurred While Loading the Java VM” error by launching the installer inside Command Prompt via the LAX_VM parameter.
Follow the guide below to open the installer with the LAX_VM parameter via Command Prompt:
Note: Keep in mind that the following steps assume that the installer in question is named installer.exe and the location of the Java JDK is in C:\Program Files\Java\jdk1.8.0_60\bin\java.exe. Please replace installer.exe with the name of your installer and modify the location of the JDK if you installed it in a custom location
- Press Windows key + R to open up a Run command. Type “cmd” and hit Enter to open Command Prompt.
- Inside Command Prompt, use the “CD” command to navigate to the location of the installer. The default location for browser downloads is C:\Users\*YourUsername*\Downloads.
Note: If you have your installer in a different location, adapt the command accordingly.
- Once you’re in the location of the installer, paste the following command into Command Prompt and press Enter:
installer.exe LAX_VM "C:\Program Files (x86)\Java\jre6\bin\java.exe"
Note: Adapt this command to your installer’s name and the location of the JDK/JRE (if installed in a custom location). If Command Prompt says it’s unable to find the JRE location, replace the last part with “C:\Program Files\Java\jdk1.8.0_60\bin\java.exe”.
If you manage to use the LAX_VM parameter correctly, you should be able to open the installer without the “Windows Error 2 Occurred While Loading the Java VM” error. If you’re still having problems opening the installer, continue with Method 3.
Method 3: Deleting java path from System Environment
If Method 2 didn’t resolve your situation, let’s see if deleting the javapath file will resolve the “Windows Error 2 Occurred While Loading the Java VM” error.
Some users have been able to open the Launch Anywhere installer by deleting the javapath system variable from System Properties. Here’s a quick guide to doing this:
- Press Windows Key + R to open up a Run window. Type “systempropertiesadvanced” in the Run box and hit Enter to open the Advanced tab of System Properties.
- In the Advanced tab, click on the “Environment Variables…” button.
- If present, select javapath under System variable and click the Delete button. You will be able to identify it via its location” C:\ ProgramData \ Oracle \ Java \ javapath.
If deleting the javapath folder didn’t do the trick or, it was not present among the System variables, move down to the final method.
Method 4: Adding a Path variable to the system
If all the methods above have failed you, let’s see if adding the correct Java to the Environment Variables will eliminate the “Windows Error 2 Occurred While Loading the Java VM” error. Here’s a quick guide to doing this:
- Press Windows Key + R to open up a Run window. Type “systempropertiesadvanced” and hit Enter to open the Advanced tab of System Properties.
- In the Advanced tab, click on the Environment Variables… button.
- Next, scroll down to the list of System variables, identify the Path variable and hit the Edit button.
Note: If no Path variable is present, create one via the New button and name it Path.
- In the Edit Environment Variable window, click on New, add the following path and hit Enter:
- Click OK to save the changes, reboot your computer and relaunch the installer again. You should find that it’s running without the “Windows Error 2 Occurred While Loading the Java VM” error.