Reputation: 6479
After Apple got rid of "Java Preferences" tool is there a clean way to fix the mess left behind with symlinks to the java tools that still point to the old Apple's JDK?
I've set my JAVA_HOME=$(/usr/libexec/java_home)
And when I do "which java" it looks fine
gubatrons-macbook-pro-3:frostwire-desktop gubatron$ which java
/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/bin/java
but when I try to execute java, it's still using the java in /usr/bin/
gubatrons-macbook-pro-3:frostwire-desktop gubatron$ java -version
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)
is there a clean way to get rid of the old Apple JDK?
Upvotes: 3
Views: 544
Reputation: 6062
Welcome to Steve Jobs' last laugh: the java in /usr/bin
is actually a stub that points to the real java; there is actually only one version of JVM in use.
Check out the linked answer here: Need help understanding Oracle's Java on Mac
Upvotes: 0
Reputation: 10814
Here is what works for me so far:
JAVA_HOME=`/usr/libexec/java_home -v 1.6`
This forces usage of the most recent version of Java 1.6 installed on your system.
See the java_home
man page for further details.
Upvotes: 0
Reputation: 11733
The right answer is to just understand how the soft links and pointers work, rather than just delete versions. It seems kind of loopy at first, but it's pretty straightforward. Explanation here. This is a better explanation here: Mac OS X 10.6.7 Java Path Current JDK confusing
Upvotes: 1