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.
thanks very much!
mine does not work
Even mine doesn’t work :(
Doent work
yeah mine dont work either
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.
mine also doesnt work
mine didnt work sadly
delete mc launcher and install it again it might just work
Thanks. It worked for me!
Thanks! You save my day
Brilliant! Thank you very much!
nice job, it solved a lot problems for me!
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
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?
Thank you very much,the fix you have provided worked for me.
Wow.. Very Useful Method.. It is working.. Thank You Very Very much….
muchas graaaacias
Thanks a lot! It works!
Spasibo ogromnoe! Rabotaet!
thank you
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)
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
its not working for me after i add java_options in envt varibale path
yes….its not working
WORKS.Thanks.<3
thank you so much
its worked for me..thank u
Hey Guys try this
1.uninstall java
2.restart your computer
3.install the newest update of java!
yes its works for me…
Excelente! :)
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…
there is a problem to install Eclipse
could not create java virtual machine
Do not work!!!!!!!!!!!!!!!
It worked
Thanks
Its not working for me, could u suggest any other ways to fix the issue
Not working
Thanks. It work for me.
WOW! SICK! Nice doesn’t work… send halp just want to play my games.
THANKS
didn’t work pls help!!!! ive tried just about everything even going up to 4096 NOTHING!!!!!
I think it is because of java. Ex. java 10 do not support other program that use lower version
mine is worked. thank you.
Brilliant! Thank you very much!
My game still works, but nothing changed…
oh,thanksï¼
tnx… it worked.
not working for me while installing eclipse even i have set it 1024. Still getting same error on windows 10. Please suggest solution.
didn’t work for me on windows 10 even on 1024. please update instructions for newer software
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.
It really worked. I searched a little bit but found different errors, and this worked for me. Thank You very much
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
Update the below line will resolve this issue.
-vm
C:\Program Files\Java\jre7\bin\client\jvm.dll
-vmargs
It worked thank you
Hi guys
It takes 4g ram memory
or choise other java version
wow man it work!!!! for real man,Thank!!!!!
this still didnt work
doesn’t work
Thanks this worked
cant get it to work
worked for me thanks a lot
delete and install mc launcher