## 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