5

Pre-note: This is not a problem I am having with Minecraft. All answers I can find seem to be related to Minecraft.

Error: could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

I get this error when I try to do something Java related. I cannot launch a .jar without this error coming up and when I try to install JDK, I get this error. This has been plaguing me for a while and I was not able to research an answer so I thought I would ask it myself.

EDIT: Windows 7 (x64) Dell Studio Laptop, 4GB RAM, external Radeon HD 6950 Graphics Card. I have tried uninstalling all JVMs and reinstalling but it didn't work, although I cannot remember how thorough I was so I may try again. Here is a list of all the Java related things I have installed (found in the uninstall or change programs window):

  • Java 3D 1.5.1
  • Java 3D 1.5.1 (x64)
  • Java 3D 1.5.2
  • Java 6 Update 30
  • Java 6 Update 30 (64-bit)
  • Java 7 Update 2
  • Java 7 Update 3 (64-bit)
  • JavaFX 2.0.3 (64-bit)
  • JavaFX 2.0.3 SDK (64-bit)
5
  • What command are you issueing? What version of the JVM do you have installed?
    – Guillaume Polet
    Commented Apr 3, 2012 at 11:49
  • Also, what operating system? What machine? What architecture? How much ram do you have?
    – mcfinnigan
    Commented Apr 3, 2012 at 12:02
  • Edited to include more info. Thanks for the help so far though.
    – Gleeson9
    Commented Apr 3, 2012 at 14:15
  • In a windows command prompt (Start > All programs > Accessories) type the following commands (without quotes) and include their output in your question please: 'java -version', 'echo %JAVA_HOME%' and 'echo %PATH%'
    – Ali
    Commented Jan 3, 2013 at 12:15
  • This error might occur because you invoke java by supplying the wrong arguments/options. Commented Nov 4, 2015 at 20:57

1 Answer 1

1

I had this problem recently, and found that the instructions HERE fixed it.

In a nutshell, the instructions show you how to make a System Variable for Java called _JAVA_OPTIONS with the value Xmx512M. This sets a global maximum heap memory size for Java.

There was one caveat I noticed though. I noticed that if you start a Java application with a maximum heap memory size larger than the one set as the System Variable, you will get errors that stop the Java Virtual Machine from running.

You must log in to answer this question.