I have two versions of Java installed with Mountain Lion:
- Apple's Java 6 Update 37 (Java for OS X 2012-006)
- Oracle's Java 7.
The update from Apple removes Java Preferences. In another question someone wonders about the removal of that utility.
My question is different:
- how can I switch between the two versions now that Java Preferences is gone?
I previously used Apple's utility to set Java preferences with ease. Without that utility, is there an easy and fast way?
Best Answer
You may need two approaches:
My recent use case:
To switch the applet plug-in but not other parts of the JRE/JDK from Java 8 to Java 7 Update 9
Setting aside: suggested move
If you plan to switch frequently, you may prefer a different temporary location.
Result
At the same time:
To switch the applet plug-in but not other parts of the JRE/JDK from Java 7 Update 9 to Java 6 Update 37
Answers under:
To switch the JRE but not the applet plug-in from Java 8 to Java 7 Update 9
Install JDK 7 Update 09 then JDK 8
Quit any apps that use Java. No need to quit the browser.
Set aside the
jdk1.8
… directory from/Library/Java/JavaVirtualMachines
To switch the JRE but not the applet plug-in from Java 7 Update 9 to Java 6 Update 37
Quit any apps that use Java. No need to quit the browser.
Set aside the
jdk1.7
… directory from/Library/Java/JavaVirtualMachines
Example
Generally
For users of OS X, some of what's provided by Oracle is initially misleading:
… and so on.
Simplicity
Whilst none of the above is as simple as switching with the Java Preferences app previously installed by Apple, the relatively simple approach of setting aside (no need for special uninstallation) is reminiscent of the wish for drag-and-drop installation … previously expressed in the openjdk-osx-build area.
Someone might like to build an app, but I should not recommend using symlinks – it would work, but could be inconsistent with future drag-and-drop approaches to installation.
Side notes
At the time of writing, the most recent supported releases for which Oracle makes updates publicly available are (for platforms other than OS X) Java 6 Update 37 and (for platforms including OS X) Java 7 Update 9.
As greater releases will be made available, please reinterpret this answer accordingly.
Java version terminology in this answer is in line with Java Help Center terminology.