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.