Type to search

Could Not Create The Java Virtual Machine: Quick And Easy Fixes

Sometimes, while trying to open an application that uses Java, users encounter the “Could not create the Java Virtual Machine” error. Once encountered, this error will not allow you to launch the application which in most cases are games. Users report that they are encountering this particular error message while trying to launch Minecraft or Triple-A which are computer games that use Java for its operation. The error message reads as:

Error: Could not create the Java Virtual Machine

Error:  A fatal exception has occurred. The program will exit.

So, if you too are facing this error and want to resolve it fast, then you need to go through the fixes mentioned in this article. The solutions we have provided here, are tested and approved and has helped a number of users to get rid of the issue in no time. So, read on to know more.

Probable Causes Behind “Could Not Create the Java Virtual Machine” Error

There are a couple of factors that can lead to this error. They are:

  1. The wrong applications are invoking Java: At times, some open-source applications that are known to cause issues may cause this one as well.
  2. Java global maximum heap memory is not sufficient: When the maximum heap memory size of the Java application you are trying to start is larger than the one set as System Variable, you can face this error.
  3. Java application needs administrative privileges: The error might also trigger when the Java executable you are trying to run requires admin access to run correctly

If you are facing this error, then you can be sure that one of the above three factors are triggering this issue on your Windows system. So, to fix it, you need to follow the fixes as mentioned below.

Fixes to Resolve “Could not Create the Java Virtual Machine” Error

Fortunately, there are some solutions that you can try to fix this error on your own. Try to follow the fixes exactly as given. Do not skip any step. You may not need to perform all the fixes. Just follow the solutions down the list and find the fix that works to resolve the issue on your system.

Solution 1: Increase the System Memory Allocated to Java

Java on Windows uses an initial size of 16MB and a maximum of 64MB. These sizes are set as System Variables, and if the application you are trying to open has a maximum heap memory size larger than that, then it might show you this Java Virtual Machine error.

So, to fix it, you need to increase the System memory allocated to Java. And, the steps for doing that are explained below.

  1. Open Control Panel and set the View by section to Large Icons.
  2. Next, click on System.
  3. Now, look for and click on Advanced System Settings.
  4. Now, in the Advanced tab, click on Environmental Variables.
  5. Under System Variables, click on New.
  6. Set the variable name as _JAVA_OPTIONS and set the variable value to -Xmx512M. Click OK for the changes to take effect.

Now, try opening the application for which you faced the error and check if this method resolves the issue.

This process raises the allowed memory to 512MB, and if the allocated memory was the culprit behind the error, then this method will resolve it. However, if it does not resolve the issue, then you need to follow the fix mentioned below.

Solution 2: Open Java with Admin Rights

Several users were able to resolve the “Could not create the Java Virtual Machine” error by simply opening the main Java executable (java.exe) and the application that is showing the error with administrative privileges. The steps to follow to do that are:

  1. Open Windows File Explorer and navigate to the location where Java is installed on your system. By default, it is C:/ Program Files/ Java/ *JRE build version*/ bin. The location might vary according to the Java Runtime Environment you are using.
  2. Now, right-click on the Java executable i.e. java.exe and select Properties.
  3. Next, click on the Compatibility tab and under Settings, check the box next to Run this program as an administrator. Click on Apply.
  4. Now, right-click on the application that is showing the error and go through the same steps i.e. Properties> Compatibility> Run this program as an administrator.

Now, try running the application to check if the issue is fixed or not.

These are the complete steps and procedure to resolve the “Could not create the Java Virtual Machine” error on your Windows PC. Hopefully, after going through the procedures as mentioned and applying them accordingly, you can fix the issue by yourself. If you have any query regarding the solutions or are finding it difficult to follow and apply them, you can leave your feedback in the comment section below.