Fix Error: Could not create the Java Virtual Machine on Windows
This tutorial explains how you can fix Java virtual machine creation errors on Windows.
Every now and then I like to play a relaxing computer game, and the excellent strategy game TripleA was my game of choice yesterday. It is a Java-based game but since the machine I wanted to run it on had Java (only untied from the browser) , I did not think that this would be an issue.
When I tried to start the game though after installation it quit immediately afterwards. The error message that it displayed was definitely Java related:
Error: Could not create the Java Virtual Machine
Error: A fatal exception has occurred. Program will exit.
First thing I did was double-check to make sure that Java was indeed properly installed - it was. It was the most recent version and the game should just run fine using it according to the game's website.
After some digging around and testing I came up with a solution for the issue that worked and resolved the error message so that the Java application started just fine. It involves changing how much memory Java is allowed to use on the system.
Java on Windows uses an initial size of 16 Megabyte and a maximum of 64 Megabyte. You can find that out by yourself by running the command java -XX:+PrintFlagsFinal -version on your machine. Check the InitialHeapSize and MaxHeapSize values here (displayed in Bytes).
Now, to resolve the error message we need to increase the size that Java can use for memory. Here is how that is done (demonstrated using Windows 7, may differ slightly on other versions of Windows):
- Tap on Windows-Pause to open the System Control Panel applet. You can alternatively open the control panel manual to go there if you prefer it that way.
- Click on advanced system settings on the left.
- Select environmental variables here.
- Click on new under System Variables.
- Enter _JAVA_OPTIONS as the variable name.
- Enter -Xmx256M as the variable value.
- Click ok twice.
The setting is available right away, you do not need to restart the computer first. It raises the allowed memory to 256 Megabyte. If your application does not run fine afterwards, try raising the memory to 512 or even 1024 Megabyte instead.
Note that this increases the maximum heap size only. If you also need to increase the minimum heap size, use -Xms256M for that.
delete and install mc launcher
worked for me thanks a lot
cant get it to work
Thanks this worked
doesn’t work
this still didnt work
wow man it work!!!! for real man,Thank!!!!!
Hi guys
It takes 4g ram memory
or choise other java version
It worked thank you
Update the below line will resolve this issue.
-vm
C:\Program Files\Java\jre7\bin\client\jvm.dll
-vmargs
Quite often a program has a bootstrap file that points to the VM, and if it is not set up correctly, you get this message, even if PATH and JAVA_HOME are set. Here’s a little overview of fixing that exact problem in Eclipse:
https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-fix-the-Eclipse-No-Java-virtual-machine-was-found-install-error?poster=me
It really worked. I searched a little bit but found different errors, and this worked for me. Thank You very much
At work computer (i5, 16GByte RAM) I added the JRE folder (1.8) of another system to the AsciiDocFX editor’s root folder. By doing this, AsciiDocFX can be used as a portable application without the need to have Java installed.
Thought I tried that after seeing that Oracle database client software (for Windows) uses the same trick. And it works just fine. Created an archive from it and distributed this on several workstations and servers (Intel and AMD). No problem, it works as intended on machines with Windows 7 till Server 2019 and everything in between.
Now I take that archive home to work on a big documentation project. It extracts just fine, but when I try to start the AsciiDocFX editor, I get a warning message saying that AV software, firewall or heap memory problem prevents the JVM from starting.
My home machine has Windows 10, 24GByte of RAM and a AMD 4.1GHz A10 (APU) processor. Which is equivalent in processing power as my i5 at work (tested that by re-encoding the same video takes practically the same amount of time on both boxes).
javaw -XX:+PrintFlagsFinal | find “InitialHeapSize”
java -XX:+PrintFlagsFinal | find “InitialHeapSize”
Executing either line at the command prompt (running as admin) results in the message that the JVM cannot be started.
– Creating a firewall rule or even completely disabling the firewall (incl. reboot) did not help. The problem remains.
– Disabling the Windows Defender AV (incl. reboot) did not help. The problem remains.
– Putting the following content in a batch file: \\\bin\java -Xms256m -Xmx512m \\\AsciiDocFX and use that batch file to start AsciiDocFX…did not help. The problem remains.
At work I applied this trick with 4 other Java based applications and till now I have had no need to install Java on any of my workstations. And these other applications work on my home system too.
The reboots should have cleared the heap memory from Windows. From the above you could deduce that I am not a fan. Which would be close to the truth. However, because of these “adventures” today, to me Java == filth.
didn’t work for me on windows 10 even on 1024. please update instructions for newer software
not working for me while installing eclipse even i have set it 1024. Still getting same error on windows 10. Please suggest solution.
tnx… it worked.
oh,thanksï¼
My game still works, but nothing changed…
Brilliant! Thank you very much!
mine is worked. thank you.
I think it is because of java. Ex. java 10 do not support other program that use lower version
didn’t work pls help!!!! ive tried just about everything even going up to 4096 NOTHING!!!!!
THANKS
WOW! SICK! Nice doesn’t work… send halp just want to play my games.
Thanks. It work for me.
Not working
Its not working for me, could u suggest any other ways to fix the issue
It worked
Thanks
Do not work!!!!!!!!!!!!!!!
there is a problem to install Eclipse
could not create java virtual machine
i was try but it not success plz say to another way
Ive tried this and I have had no success but I am with Windows 10. Anyone helps me…
Excelente! :)
yes its works for me…
Hey Guys try this
1.uninstall java
2.restart your computer
3.install the newest update of java!
its worked for me..thank u
thank you so much
WORKS.Thanks.<3
its not working for me after i add java_options in envt varibale path
yes….its not working
Ive tried this and I have had no success but i am with windows 10
same i think this thing is broken
so um yeah no way of fixing java fo windows 10
I get :
java.lang.IndexOutOfBoundsException: Index: 14, Size: 14
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.datanomic.director.eventlogger.client.EventLogController.updateColumns(EventLogController.java:502)
at com.datanomic.director.eventlogger.client.EventLogController.initUI(EventLogController.java:361)
at com.datanomic.director.eventlogger.client.EventLogController.access$700(EventLogController.java:99)
at com.datanomic.director.eventlogger.client.EventLogController$1.finished(EventLogController.java:207)
at com.datanomic.director.guihelper.SwingChore$1.run(SwingChore.java:90)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at com.datanomic.utils.blueprints.ui.chores.ChoreMaster$InvokeQueue$Invoker.run(ChoreMaster.java:600)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
thank you
Thanks a lot! It works!
Spasibo ogromnoe! Rabotaet!
muchas graaaacias
Wow.. Very Useful Method.. It is working.. Thank You Very Very much….
Thank you very much,the fix you have provided worked for me.
It was not worked for me. Still getting same error after increasing heapsize to 512 as well.
Could not create the Java virtual machine
Any further solution to fix this?
It is not working me, I still get an error ‘Could not create Java Virtual machine’
Any further thoughts on this?
Increased it to 1024M and it is not working, trying to run a patch for Skyrim
nice job, it solved a lot problems for me!
Brilliant! Thank you very much!
Thanks! You save my day
Thanks. It worked for me!
thanks very much!
delete mc launcher and install it again it might just work
mine didnt work sadly
mine does not work
mine also doesnt work
Try this: go to environment variables/ click on edit/ type the variable name ‘Java’ without quotes/ give the location of java.exe in variable value
Worked for me.
yeah mine dont work either
Doent work
Even mine doesn’t work :(