PDF download Download Article
Troubleshooting guide for the Java Virtual Machine error
PDF download Download Article

Do you get a "Could Not Create the Java Virtual Machine" error whenever you try to play Minecraft? This annoying error could point to a few solutions, so try as many as you need to in order to get rid of the error. Read on to learn multiple ways that you can fix the Java Virtual Machine on your computer.

Ways to Fix the Minecraft Java Virtual Machine Error

  • Create a new system variable with the name "_JAVA_OPTIONS" and the value "-Xmx1024M."
  • Right-click the Java.exe file on your computer and check the "Run as administrator" box to always run it with administrator permissions.
  • Re-install Java to get rid of any corrupted files and stay up-to-date.
Section 1 of 4:

Adding New System Variables

PDF download Download Article
  1. If you type after pressing the Win key, you can start a search for anything on your computer.
    • Doing this will list search results that include "edit the" on your computer.
  2. 2
    Click the search result called "Edit the system environment variables". A "System Properties" window will open.
    • You can also get here by pressing Win + R and entering sysdm.cpl . Pressing Enter will open the "System Properties" window.
    Advertisement
  3. 3
    Click Environment Variables . It's inside the Advanced tab if you don't immediately see it at the bottom of the window.
  4. 4
    Click New… under "System variables". It's the 2nd big box, towards the bottom of the page.
  5. 5
    Change the appropriate system variables. Enter _JAVA_OPTIONS for "Variable name" and -Xmx1024M for "Variable value". You must use the same capitalization and punctuation.
  6. 6
    Press OK to save and close the window. You'll see the new variable in the "System variables" section.
    • Close all the windows by clicking the X in the top right corner, then restart your computer.
  7. Advertisement
Section 2 of 4:

Running Java as Administrator

PDF download Download Article
  1. 1
    Search Java.exe . This will display every "Java.exe" file on your computer.
  2. 2
    Right-click the first result and select Open file location . You can also skip the search if you know where the file is located on your computer.
  3. 3
    Right-click the "java.exe" file and select Properties . Right-clicking it opens a menu at your cursor with more options, and clicking "Properties" opens a new window.
  4. 4
    Click the Compatibility tab. This lists a bunch of compatibility features.
  5. 5
    Click to check the box next to "Run this program as an administrator." Checking this box makes the program run as an administrator every time it opens, which will eliminate a lot of errors.
  6. 6
    Click Apply and OK . This will close the window. Click the X in the top right corner to close other windows.
  7. Advertisement
Section 3 of 4:

Re-installing Java

PDF download Download Article
  1. Press Win + I .
    • Do this after trying the other steps, which should eliminate the error message.
    • This is more likely to help if you have corrupted or broken Java files that trigger the error, as well as an older version of Java that no longer works.
  2. 2
    Click Apps and go to "Installed apps". This will list every installed program on your computer.
  3. 3
    Uninstall Java. For Windows 10, click Java and select Uninstall . For Windows 11, click the three dots next to Java and select Uninstall .
  4. 4
    Visit the official Java Runtime Environment page and download Java. Open it in your web browser.
    • Click Download Java for Desktops to find the download page.
    • Click Download Java for Desktops again to save the installation file. The best one for your operating system is automatically selected.
  5. 5
    Run the downloaded file to install Java. Once done, Java has been reinstalled and any corrupted files that caused the "Could Not Create the Java Virtual Machine" are gone.
    • Restart your computer after reinstalling Java.
  6. Advertisement
Section 4 of 4:

Answers from Around the Web

PDF download Download Article
  1. Some Reddit users found creating a .bat file with this code helpful. [1] Copy and paste the following code into a blank Notepad document and save it as a .bat file. Run it before launching Minecraft.
    • @ECHO off
    • ECHO.
    • ECHO This will remove _JAVA_OPTIONS from your environment variables for the system and for your user account.
    • ECHO.
    • ECHO.
    • ECHO Be sure to run this as administrator.
    • ECHO Right click the file and select "Run as administrator" else it may not work correctly.
    • ECHO.
    • PAUSE
    • SETX _JAVA_OPTIONS "" /m
    • SETX _JAVA_OPTIONS ""
    • ECHO.
    • ECHO Process complete. Restart ATLauncher to ensure it's working.
    • ECHO.
    • PAUSE
  2. 2
    Go to your Curseforge settings and delete the additional arguments. Others on Reddit found this trick to be more useful if they used Curseforge. [2]
    • What you should have left is: (-XX:FreqInlineSize=9 -XX:MaxInlineSize=9 -d64+ -XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=100 -XX:G1HeapRegionSize=32M)
  3. 3
    Download the correct version of Java. More users on Reddit found the solution in their Prism Launcher. [3]
    • The fix? Go to Prism Launcher > Settings > Java > Auto-detect files to select the correct installed version.
  4. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!

      About This Article

      Thanks to all authors for creating a page that has been read 24 times.

      Is this article up to date?

      Advertisement