Could not create the Java virtual machine [Fixed]

Matthew Adams
by Matthew Adams
Windows & Software Expert
Download PDF
Affiliate Disclosure

  • Many users describe encountering the same Could not create the Java virtual machine error when launching an application.
  • Before reinstalling Java, you can try setting up a new system variable for Java, to see if it makes any difference. 
  • Even if this issue is reported to occur with Minecraft, things are no different when trying to use other apps that are built around Java.
  • For more quick fixes as the ones here detailed, visit our Tech Troubleshooting Hub.
Fix Java virtual machine

The Java virtual machine fatal exception error pops up for some users when they try to launch software built on Java. Minecraft users are no stranger to this issue.

The full error message states: Could not create the Java Virtual Machine. Error: A fatal exception has occurred.

Consequently, the Java program doesn’t run. These are a few potential fixes for the Java Virtual Machine fatal error.

How to fix Java virtual machine error?

1. Set up a new system variable for Java

  1. Open Run with the Windows key + R keyboard shortcut.
  2. Enter sysdm.cpl in Run and click OK to open the window in the image directly below.
  3. Select the Advanced tab on that window.
  4. Click the Environment Variables button to open the window below.
  5. Click the New button under the System variables box.
  6. Enter _JAVA_OPTIONS in the Variable name text box.
  7. Then, enter –Xmx512M in the Variable value text box, which increases RAM allocation to 512 megabytes.
  8. Click the OK button to close the window.
  9. Then press the OK button on the Environmental window.

The Java Virtual Machine error often arises when Java needs a larger global maximum heap memory size.

Users have fixed the issue by expanding the maximum RAM allocated to Java. Users can do that by establishing a new Java System Variable as described above.

2. Select the Run as Administrator option for Java

  1. Open Cortana with the Windows key + Q keyboard shortcut.
  2. Enter Java in the search box.
  3. Then right-click Java and select Open file location to open Java’s folder in File Explorer.
  4. Now users can right-click the java.exe and select Properties.
  5. Select the Compatibility tab.
  6. Select the Run this program as an administrator option.
  7. Select the Apply option.
  8. Click OK to close the window.

The Java virtual machine error can also be due to insufficient admin rights. Thus, some users might need to assign admin rights to Java.

Users can assign admin rights to Java in Windows 10 as described above.

3. Reinstall Java

  1. Reinstalling Java might also fix the Java virtual machine error for some users. First, uninstall the currently installed Java version by entering appwiz.cpl in Run and clicking OK.
  2. Enter Java in the search box.
  3. Select Java and click Uninstall.
  4. Click Yes on any confirmation window that opens.
  5. Thereafter, restart Windows.
  6. Then open the Java download page in a browser.
  7. Users need 32-bit Java for 32-bit programs and 64-bit Java for 64-bit software. If in doubt, your best bet is to download and install both Java versions by clicking Windows Offline and Windows Offline 64-bit.
  8. Thereafter, open the Java setup wizard.
  9. Click the Install button on the setup wizard.

So, that’s how users can fix the Java virtual machine fatal error and get back to running the required Java software.

Any of the previously mentioned solutions may be successfully applied in these scenarios:

  • Java virtual machine launcher error – This issue arises even if nothing has changed on your computer and it’s most likely related to Java installation.
  • Could not create the Java virtual machine a fatal exception has occurred – This problem also seems to appear randomly. Make sure you aren’t using a 32-bit VM and a 64-bit Eclipse.
  • Minecraft could not create the Java virtual machine – This error shows up when trying to launch Minecraft. The main reason is that it needs admin access in order to function properly.

FAQ: Learn more about the Java virtual machine

  • What is JVM in simple words?

In plain language, JVM is a virtual machine that enables a computer to run Java programs.

  • How do you fix JVM could not be started?

To fix the annoying Java virtual machine error, you may try to start in 64-bit mode or use the steps described in this detailed guide.

  • What is a virtual machine error in Java?

Getting a virtual machine error is a sign of insufficient admin rights or that Java needs a larger global maximum heap memory size.

Editor’s Note: This post was originally published in February 2019 and has been since revamped and updated in June 2020 for freshness, accuracy, and comprehensiveness.

Editor's Note: This article was originally published in February 2019 and was revamped and updated in June 2020 for freshness, accuracy, and comprehensiveness.
Was this page helpful?
Thanks for letting us know! You can also help us by leaving a review on MyWOT or Trustpillot.
Get the most from your tech with our daily tips
Tell us why!