How to fix the Java Virtual Machine fatal error in Windows 10

Matthew Adams
by Matthew Adams
Loading Comments
Download PDF
Affiliate Disclosure

The Java Virtual Machine fatal exception error pops up for some users when they try to launch software built on Java. 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.

Solutions to Fix Java Virtual Machine Errors

1. Set Up a New System Variable for Java

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 follows.

  • Open Run with the Windows key + R keyboard shortcut.
  • Enter ‘sysdm.cpl’ in Run and click OK to open the window in the image directly below.

  • Select the Advanced tab on that window.
  • Click the Environment Variables button to open the window below.

  • Click the New button under the System variables box.
  • Enter ‘_JAVA_OPTIONS’ in the Variable name text box.

  • Then enter ‘–Xmx512M’ in the Variable value text box, which increases RAM allocation to 512 megabytes.

  • Click the OK button to close the window.
  • Then press the OK button on the Environmental windows.

— RELATED: How to remove the ‘Java Update is Available’ popup

2. Select the Run as Administrator Option for Java

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 follows.

  • Open Cortana with the Windows key + Q keyboard shortcut.
  • Enter ‘Java’ in the search box.
  • Then right-click Java and select Open file location to open Java’s folder in File Explorer.

  • Now users can right-click the java.exe and select Properties.

  • Select the Compatibility tab.

  • Select the Run this program as an administrator option.
  • Select the Apply option.
  • Click OK to close the window.

3. Reinstall Java

  • 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.

  • Enter ‘Java’ in the search box.
  • Select Java and click Uninstall.
  • Click Yes on any confirmation window that opens.
  • Thereafter, restart Windows.
  • Then open the Java download page in a browser.

  • 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.
  • Thereafter, open the Java setup wizard.
  • Click the Install button on the setup wizard.

So, that’s how users can fix the Java Virtual Machine fatal error. Those resolutions usually fix the Java Virtual Machine fatal error so that users can run the required Java software.


Was this page helpful?
Thanks for letting us know!
Get the most from your tech with our daily tips
Tell us why!