This article was reviewed by Stan Kats and by wikiHow staff writer, Darlene Antonelli, MA. Stan Kats is a Professional Technologist and the COO and Chief Technologist for The STG IT Consulting Group in West Hollywood, California. Stan provides comprehensive technology solutions to businesses through managed IT services, and for individuals through his consumer service business, Stan's Tech Garage. Stan holds a BA in International Relations from The University of Southern California. He began his career working in the Fortune 500 IT world. Stan founded his companies to offer an enterprise-level of expertise for small businesses and individuals.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
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.
Steps
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.
Advertisement -
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.
Expert Q&A
Tips
References
- ↑ https://www.reddit.com/r/Minecraft/comments/143peo9/im_getting_error_could_not_create_the_java/
- ↑ https://www.reddit.com/r/javahelp/comments/1damm83/i_need_help_with_the_error_could_not_create_the/
- ↑ https://www.reddit.com/r/PrismLauncher/comments/1ixy769/eli5_how_to_fix_could_not_create_the_java_virtual/