Using an older version of Java JDK in Mac OSX

This StackOverflow thread gives instructions on how to How to Revert to Java 1.6.

I ran this command and got this result:


prem$ /usr/libexec/java_home -v '1.6*'
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

That directory doesn’t seem to exist according to ls:


prem$ ls /Library/Java/JavaVirtualMachines
./ ../ jdk1.7.0_67.jdk/

However, running the given command to change the JDK actually seemed to work:


prem$ export JAVA_HOME=`/usr/libexec/java_home -v '1.6*'`
prem$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

It’s still pretty mysterious to me how this works.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s