"Could Not Create the Java Virtual Machine" Error: Easy Fixes
"Could Not Create the Java Virtual Machine" Error: Easy Fixes
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

Adding New System Variables

Press ⊞ Win and search edit the. 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.

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.

Click Environment Variables. It's inside the Advanced tab if you don't immediately see it at the bottom of the window.

Click New… under "System variables". It's the 2nd big box, towards the bottom of the page.

Change the appropriate system variables. Enter _JAVA_OPTIONS for "Variable name" and -Xmx1024M for "Variable value". You must use the same capitalization and punctuation.

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.

Running Java as Administrator

Search Java.exe. This will display every "Java.exe" file on your computer.

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.

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.

Click the Compatibility tab. This lists a bunch of compatibility features.

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.

Click Apply and OK. This will close the window. Click the X in the top right corner to close other windows.

Re-installing Java

Open Settings. 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.

Click Apps and go to "Installed apps". This will list every installed program on your computer.

Uninstall Java. For Windows 10, click Java and select Uninstall. For Windows 11, click the three dots next to Java and select Uninstall.

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.

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.

Answers from Around the Web

Some Reddit users found creating a .bat file with this code helpful. 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

Go to your Curseforge settings and delete the additional arguments. Others on Reddit found this trick to be more useful if they used Curseforge. 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)

Download the correct version of Java. More users on Reddit found the solution in their Prism Launcher. The fix? Go to Prism Launcher > Settings > Java > Auto-detect files to select the correct installed version.

What's your reaction?

Comments

https://popochek.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!