What is causing the Could Not Create The Java Virtual Machine error?

We investigated this particular issue by looking at various user reports and the troubleshooting strategies that they used to resolve the same error message. Based on their conclusions, there are a couple of scenarios that will trigger this particular issue: If you’re currently looking for a way to resolve the, Could Not Create The Java Virtual Machine error, this article will provide you with several verified troubleshooting strategies. Below you have a collection of methods that other users in a similar situation have used to get the issue resolved. To ensure the best results, follow the methods below in the order that they are presented until you discover a method that is effective in resolving the error for your particular scenario.

Method 1: Adding the _JAVA_OPTIONS to System Variables

Most affected users have managed to get the issue resolved by creating a System Variable for Java called _JAVA_OPTIONS and setting it’s value to Xmx512M. What this essentially does is it sets the global maximum heap memory size for Java. This will resolve any error message that occurs because the started Java application’s maximum heap memory size is larger than the one set as the System Variable. Several users encountering the same issue have reported that the issue was resolved entirely after they performed the steps below. Here’s what you need to do to add a _JAVA_OPTIONS entry in System Variables to enlarge the global maximum heap memory size: If you’re still seeing the same error message at the start of the application, try adding the Java Bin path which might be similar to “%\USER PATH\Java\jdk1.6.0_39\bin” to the environment variable as indicated in the above method and see if that works.

Method 2: Opening java.exe with admin rights 

Several users struggling to resolve the same issue have managed to get the issue resolved after forcing the main Java executable (java.exe) to open with administrative privileges. Some users reported that they were able to resolve the issue after applying this fix on both the main java executable and the executable of the application that is showing the error message. Here’s a quick guide through the whole thing:

Method 3: Reinstalling Java

In some cases, the error is triggered because Java might not be installed properly or its installation might have been corrupted over time. Therefore, in this step, we will be reinstalling Java after uninstalling it completely. For that:

Method 4: Fixing Errors With Code

There are different reasons behind this error and some of them include if you have some particular errors with your code. We will highlight some below.

Remove Hyphen: Some users noted that the error was fixed by changing the double hyphen “–” to a single one “-” in their code. For example: Change the code “sony@sony-VPCEH25EN:~$ java –version Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar Unrecognized option: –version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.” To “sony@sony-VPCEH25EN:~$ java -version Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar Unrecognized option: –version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.”Also, Try removing the following line from your argument -Djava.endorsed.dirs=”C:\Program Files\Apache Software Foundation\Tomcat 8.5\endorsed”Open your eclipse.ini file and make sure that you add the “-vm” entry above the vm args otherwise, JVM V6 will be selected in env vars.If on Ubuntu, you should know that Java 8 is the only version that is supported. Therefore, using the third method. Uninstall Java, and install the previous version.

Method 5: Editing Eclipse.ini File

We can also tweak things inside the Eclipes.ini File to get rid of this issue. There might be a couple of issues with its configuration that need to be addressed therefore, we have divided it into separate issues. Follow the one which suits your scenario the best.

Lowering Memory Use

Tinkering Around

Checking for JDK Corruption

Create Your First Virtual Machine in Hyper-V 2019How to Create and Run a Virtual Machine With Hyper-VHow to Create a Windows 11 Virtual Machine using Hyper-VCreate your First Virtual Machine in Oracle VM VirtualBox Fix  Could Not Create the Java Virtual Machine - 40Fix  Could Not Create the Java Virtual Machine - 7Fix  Could Not Create the Java Virtual Machine - 77Fix  Could Not Create the Java Virtual Machine - 9Fix  Could Not Create the Java Virtual Machine - 20