10

I currently have Java 7 on my machine, but would like to downgrade as some unit tests in my current project fails with newer versions of Java.

Note that I am running OS X 10.9.1, and the Java installation practices have changed since previous versions of the OS.

Since Apple has changed the distribution around the time of 1.6, it's not obvious to me how I get the old version. Oracle does not supply Mac packages of 1.6 :(

Clues?

Anders Johansen
  • 10,165
  • 7
  • 35
  • 52

2 Answers2

13

The OS/X Mavericks ships with Java 1.6, but in case you've installed another version, you can get back with 1.6 if you download a bundle of Java SE 1.6.0_65 from Apple.

If you've installed a later version of Java, e.g. 1.7, for all users, installing the bundle mentioned above will most likely break your existing newer installation.

  • 3
    It does not appear to break a 1.7 install. Also update your .profile like so: export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) change to 1.7 for using version 1.7. – Anders Johansen Feb 25 '14 at 08:57
1

The response here from Sami Laine didn't help me but this StackOverflow page did: Java 6 Unsupported major.minor version 51.0

To step down from Java 1.8 to 1.6 to support a legacy codebase, I also had to step down Maven from 3.3 to 3.2.

Matthew Kuraja
  • 401
  • 4
  • 7