Technology

Could Not Create the Java Virtual Machine : Stepwise Instruction to Resolve

could not create the java virtual machine

Oftentimes, you might get an error saying ‘could not create the java virtual machine’ when you try to open any application that uses java. There are a few reasons that can cause this problem. However, the most common issue is the low memory allocated to the program for execution. Accordingly, you might face this error while trying to open an open-source application or a homemade application. Other times, Java may not have the required administrative privileges to run the application properly. 

Methods to Resolve ‘Could Not Create The Java Virtual Machine’ Error 

There are a few effective ways to get rid of this problem. Here, we have discussed all the ways in the following section. Thus, go through these steps accordingly to fix the error effortlessly. 

Solution 1: Allocate More Memory Space to Java 

Allocate More Memory Space to Java 

Incidentally, Java is allocated only up to 64 MB by default. Therefore, you may get the ‘Could not create the Java virtual machine’ problem if the application needs more than 64 mb of memory. Hence, you need to increase the maximum memory for Java by following the given steps. 

  1. First, press the Windows key and ‘R’ at the same time on your keyboard. This will launch the Run dialogue box. 
  2. After that, type “sysdm.cpl” in the text field and then tap on the OK option. 
  3. Then, go to the Advanced tab and click on the Environment Variables button. 
  4. After that, navigate to the System Variables box and tap on the New button. 
  5. Head over to the Variable name text box to type ‘_JAVA_OPTIONS’. 
  6. Thereafter, you need to type ‘-Xmx512M’. This will help you to increase the memory space allotment to 512 megabytes. 
  7. Now, close the window and for that select the OK option. 
  8. Finally, go to the Environmental windows and then tap on the OK button. 

Solution 2: Grant Admin Rights to Java.EXE

Grant Admin Rights to Java.EXE

As stated earlier, you may face this issue if the Java application doesn’t have the necessary admin rights. Thus, you can resolve this problem by performing the below-mentioned steps. 

  1. Initially, launch the File Explorer by pressing the Windows logo key with the letter ‘E’ at the same time. 
  2. Next, head over to the main directory where Java is installed. There, find and locate the java.exe file. You can find this application in Program Files/Java/*JRE build version*/bin. However, it depends on which Java Runtime Environment you want to optimize. 
  3. Right click on the file and select the Properties option. 
  4. After that, navigate to the Compatibility tab and check the option for “Run this program as an administrator”. 
  5. Now, save the changes by clicking on the Apply and then on the Ok option. 
  6. Select the application that caused the error and do the same. 

Finally, you need to run the application and check whether the error message has been fixed or not. 

Solution 3: Reinstall Java 

Reinstall Java 

As a last alternative, you can try to fix the problem by reinstall Java. Thus, follow the steps given below to reinstall Java. 

  1. First, you have to uninstall the current Java version. For that, go to the Run dialog box by pressing the Windows logo button with the letter ‘R’. 
  2. Next, type ‘appwiz.cpl’ and press the Enter key to launch the Programs & Features window. 
  3. After that, navigate to the search box to enter ‘Java’. 
  4. Next, click on Java and follow the Uninstall instructions. If asked for any confirmation, simply click on the Yes option. 
  5. Finally, restart your Windows system. After restarting, open any browser and visit the official website of Java. 
  6. There, select your system type and download the correct software for your Windows operating system version. Make sure you have chosen 32 bit or 64 bit according to your system type. 
  7. Now, run the downloaded Java setup wizard as an Administrator by right clicking on it. Next, follow the instructions as displayed and complete the installation procedure for Java. 

Thereafter, try to launch the program once again. Check if the error message is still appearing or not. 

Conclusion 

Lastly, you should be able to get rid of the ‘could not create the java virtual machine’ error message by following the above steps. Generally, allocating a larger memory space helps to resolve the issue without any hassle. You can even try to increase this size if you are still facing the problem. Alternatively, you can hope to resolve the issue by performing a clean reinstallation of Java.