OS X 10.8 removed Java 6 and the Java Utilities switcher and made Java 7 the default jre making it hard for engineers like me who work exclusively on Java 6. How do I get back my Java 6? Note: I tried Google but many of the supposed solutions are outdated.
Asked
Active
Viewed 1.5k times
1 Answers
5
The simplest solution I found is to
- Download the jdk6 (download button is on top right)
Unpack it to somewhere. Preferably to
/System/Library/Frameworks/JavaVM.framework/Versions/1.6. This is what it looks for me:> ls /System/Library/Frameworks/JavaVM.framework/Versions/1.6 Classes Commands Home Info.plist Libraries MacOS Resources version.plistSet your
$JAVA_HOMEto your new location by doingexport JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/before your$PATHin your~/.bashrc(or~/.zschrc) file- Prepend
$JAVA_HOMEto your$PATHby doing thisexport PATH=$JAVA_HOME/bin:/usr/bin:/bin:/us.......... - Restart your shell or do
source ~/.bashrc
pathikrit
- 2,093
-
1I think they have changed the link to the JDK6 that you posted. it now is a DMG with a .pkg installer. Now way to extract it to a directory. – Amala Apr 08 '13 at 14:42
-
@Amala The installer will use the mentioned directory automatically. – ᴠɪɴᴄᴇɴᴛ Feb 11 '16 at 16:25