Switching Between Java 6 and 7 on OS X Lion

January 2, 2013
os x java

This took me too long to figure out, so I’m writing this up now.

To switch from Java 7 to Java 6 on Lion:

sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/Current  
sudo ln -sf /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents  /System/Library/Frameworks/JavaVM.framework/Versions/Current  

To switch from Java 6 to Java 7:

sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/Current  
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Versions/A  /System/Library/Frameworks/JavaVM.framework/Versions/Current

There’s something deeply suspicious about this, but at least it works.

More recently Talk to the Teddy     Ruminations on Code Bases I Have Known Less recently

Android: Forking Java by Mistake

February 26, 2015
tech java

Time Keeps Ticking

September 9, 2013
testing java