42

When I upgrade to Mavericks, it uninstalls Java 1.6. I can install Java 7, but for some applications and development work, I still need access to Java 6. How can I reinstall Java 6 in Mavericks?

Apple docs generally recommend downloading Java directly from Oracle, but I don't see a Mac version listed on the Oracle download page for Java SE 6.

http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

Update

I was able to install parts of Java 6, with an Apple Support update. But Maven is still missing.

$ specs java os
Specs:

specs 0.7
https://github.com/mcandre/specs#readme

mvn --version
mvn not found

echo $CLASSPATH


echo $JAVA_HOME
/Library/Java/Home

javac -version
javac 1.6.0_65

java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

system_profiler SPSoftwareDataType | grep 'System Version'
      System Version: OS X 10.9 (13A603)

Update 2

I was able to install Maven with Homebrew:

$ brew install maven
$ mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9", arch: "x86_64", family: "mac"
1

3 Answers 3

27

You can download Java SE 6 for OS X from here: http://support.apple.com/kb/DL1572

For Maven support you can use brew (as stated above) or, if you don't want to install brew just for Maven support, you can download it directly from maven.apache.org. Here's the steps I took to get Maven setup on a fresh install of Mavericks:

curl -O http://apache.tradebit.com/pub/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
sudo mkdir /usr/local
cd /usr/local
sudo tar -xf ~/apache-maven-3.1.1-bin.tar.gz
echo "export PATH=$PATH:/usr/local/apache-maven-3.1.1/bin" >> .profile
echo "export JAVA_HOME=/Library/Java/Home" >> .profile
4
  • Does that include the JDK, with javac and mvn, or just the JRE? Oct 25, 2013 at 18:20
  • 3
    @apennebaker I didn't think Maven was part of the JDK?
    – zigg
    Oct 25, 2013 at 18:49
  • 3
    If you're using multiple version of the JDK on the Mac you'll want to know about java_home. e.g. export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) Feb 2, 2014 at 15:57
  • link is dead, fyi.. Dec 17, 2014 at 8:51
15

This works on OS X 10.11 (El Capitan). I've used Homebrew to install JDK 1.6.0_65:

brew tap caskroom/versions
brew cask install java6
4
  • FYI, this downloads from the same apple support page linked by Colin C. Oct 22, 2015 at 18:04
  • This proved to be of limited value as the end result was to stage the .pkg file, which was identical to directly downloading from support.apple.com/kb/DL1572. Guess, it is handy for new users to brew cask. thanks for the suggestion all the same.
    – arcseldon
    Nov 26, 2015 at 7:59
  • @arcseldon installing through Homebrew Cask makes it easy to update and uninstall JDK 1.6, though. May 17, 2017 at 8:37
  • as of 2021, you use brew this way: brew tap homebrew/cask-versions; brew install --cask java6
    – user861746
    Nov 8, 2021 at 13:14
13

When I tried the accepted answer, I didn't see the new JDK 1.6 in /Library/Java/JavaVirtualMachines/

I had to go to https://developer.apple.com/downloads/ search for "java", download the latest, and install that. Then the JDK 1.6 appeared.

2
  • 4
    Jave 6 will install at /System/Library/Java/JavaVirtualMachines/1.6.0.jdk by default - the one you have downloaded from the developer site, is a developer version, and will - as you have noticed - install under /Library/Java/... Feb 2, 2014 at 17:01
  • 1
    This answer gave me the missing piece to compiling JNI applications on Mavericks. Most other discussions, particularly on SO, point people to http://support.apple.com/kb/DL1572 but that does not provide a JDK. The information in this answer led me to the correct item. So, thank you, very much.
    – mhucka
    Mar 11, 2014 at 1:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .