I just installed the latest Java SDK 7-67 from Oracle on the Mac 10.9.4. I then ran the command
java -v in Terminal and I get this message:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Normally this error occurs when you invoke java by supplying the wrong arguments/options. In this case it should be the
So to double check you can always do
java -help, and see if the option exists. In this case, there is no option such as
There can be one more reason for such behavior – you delete current working directory.
# in terminal #1 cd /home/user/myJavaApp # in terminal #2 rm -rf /home/user/myJavaApp # in terminal #1 java -jar myJar.jar Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
if you tried running
-version argument, and even though the problem could not be solved by any means, then you might have installed many java versions, like JDK 1.8 and JDK 1.7 at the same time.
So try uninstalling all other versions other than the one you need, then set the
JAVA_HOMEpath variable for that JDK remaining, and you’re done.