Reputation: 5367
I've just installed Mac OSX 10.8 Mountain Lion I'm trying to install a JDK version 6 There's no Mac package for version 6 on the Oracle downloads: http://www.oracle.com/technetwork/java/javase/downloads/jdk6u37-downloads-1859587.html
But there is one for JDK version 7 http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html
Is there somewhere else I can get a Mac package for JDK 6?
Upvotes: 33
Views: 51269
Reputation: 363
java -version
to make sure you have the right version.if it's the wrong version, (e.g. java version "1.7.0_45"), then you need to modify ~/.bash_profile
:
# Java 6 for Android Development
export JAVA_HOME="/Library/Java/JavaVirtualMachines/1.6.0_65-b14-462.jdk/Contents/Home/"
Log out & log in again & make sure you're running the correct version: java -version
. Should be java version "1.6.0_65".
Upvotes: 18
Reputation: 1
As of 7/18/13, you could get the latest Mac Java 6 here:
http://support.apple.com/downloads/
Clicking the link "Java for OS X 2013-004" gets you to the download page:
http://support.apple.com/kb/DL1572
Upvotes: -3
Reputation: 31
For some bizarre reason - before Java7 it was actually apple that supplied/supported java for OSX instead of Sun/Oracle. That situation only recently changed with JAVA7. So, to get an earlier version - like Java6, go to either http://connect.apple.com - sign in with your apple Id and you will find the jdk for 1.6 listed. You can also find it via https://developer.apple.com/ - or as I already said, starting with 7, you can get it directly from http://www.oracle.com/technetwork/java/index.html
Upvotes: 3
Reputation: 12429
Unfortunately I didn't see this answer until after I already found a rather wonky solution...I'm assuming that downloading the Java installer from developer.apple.com is the easiest way of installing Java 6, but if, like me, you had installed Java 7, and you're trying to downgrade and it's not working (i.e. if installing the developer download still leaves you with Java 7 as the default version), you can download the Java package for OS 10.6 then open it using Pacifist, then copy the files over. (Copying the files from the package for 10.7 did NOT work for me - apparently it installs Java 7, or at least it leaves Java 7 as the default version with no way to choose version 6 instead).
More info here: https://stackoverflow.com/a/6413600/560114
Upvotes: 1
Reputation: 4056
As I recall, the first time you do something that needs Java the OS will ask if you want to install it, and version 6 is what you get. According to this page, typing java -version
in the Terminal is enough to trigger the prompt.
For the JDK (and not the runtime), you'll need to log into developer.apple.com, search for java
, and download the Java for OS X 2012-006 Developer Package. I just did this on my MacBook and now have javac 1.6.0_37
.
Upvotes: 34