Could not create the Java virtual machine [Fixed]

Publish date: 2024-06-13
Fix Could not create the Java virtual machine

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:
  • Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  • Click Start Scan to find Windows issues that could be causing PC problems.
  • Click Repair All to fix issues affecting your computer's security and performance
  • 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 can I fix the Java virtual machine error?

    1. Set up a new system variable for Java

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

  • Open Cortana with the Windows key + S 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.
  • 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

  • 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 and get back to running the required Java software.

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

    Read more about this topic

    Use a Java virtual machine online

    If you can’t use the Java virtual machine on your PC, you can compile your code straight online.

    For instance, a website like Online Java has a very simple interface and the app allows you to compile, run and save your programs very easily without the need for an installation.

    Moreover, you also have the option of sharing your code with friends or colleagues who can also make comments on your work and help you.

    If you have any other questions or if you have advice for other users to try, don’t hesitate to leave a comment below.

    ncG1vNJzZmivmaOxsMPSq5ypp6Kpe6S7zGihmq6RYsOqvtOumKVlnZawqbXNnmSfmaSWuW6x0aumq2c%3D