update - Reinstalling Java 7 JDK on OSX

update java mac terminal (2)

Find out where the installation directory of your Java 7 is on your Mac OS X. Set the JAVA_HOME shell variable to that directory (directory must contain a bin and lib subdirectory). Edit the path to export PATH="${JAVA_HOME}/bin:${PATH}". Try running java -version again.

If all else fails, then perhaps you will have to reinstall your OS in order to bring back Mac Java defaults and just reinstall Java 7.

I had this similar problem on Mountain Lion (10.8): after installing the Java 7 SDK, I deleted the Apple-default Java 6 JRE. This messed up my computer, especially Eclipse. The issue is related to the fact that Apple delivered the official Java JRE to Mac OS X, until Java 7 came out and Oracle became the official supplier for that version. After I reinstalled the OS, I was able to get the prompt window that asked me about downloading a Java runtime. This will reinstall the Apple Java 6 JRE.


I've tried to install Java 7 (aka 1.7) on OSX 10.7.5 (Lion).

Unfortunately this seems to have mucked up Java all together and I'm not sure how to resolve the problem. Currently when I try to run Eclipse I get the error:

The JVM shared library "/System/Library/Frameworks/JavaVM.framework" does not contain the JNI_CreateJavaVM symbol.

Programs such as Minecraft and PhpStorm will crash completely with no errors.

Running 'java -version' in terminal gives me:

java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

Which I understand is to be expected with a straight install of Java 7. Unfortunately Utilities -> Java Preferences has been removed in OSX 10.7.5, and trying to load the System Preference -> Java pane doesn't work (it tells me that it opens in a new window but doesn't, when the button appears to reload it, clicking it doesn't do anything).

I've tried reinstalling various versions of JRE and JDK to no avail.

Is there anyway to bin the lot and start again or am I missing something really obvious?

For others hitting this issue, you might try installing the latest jdk from Apple: