Skip to content

Instantly share code, notes, and snippets.

@bzz
Last active December 31, 2015 00:28
Show Gist options
  • Save bzz/7907077 to your computer and use it in GitHub Desktop.
Save bzz/7907077 to your computer and use it in GitHub Desktop.
Multiple JDK on mac os x 10.8 to switch Oracle \ Apple provided java implementations
#Thanks to http://superuser.com/questions/490425/how-do-i-switch-between-java-7-and-java-6-on-os-x-10-8-2
echo "Oracle JDK installed:"
ll /Library/Java/JavaVirtualMachines
echo "Apple supplied JDK:"
ll /System/Library/Java/JavaVirtualMachines
echo "To run a specifinc version use:"
/usr/libexec/java_home -v 1.6 --exec java -version
/usr/libexec/java_home -v 1.7 --exec java -version
echo "Or"
JAVA_HOME=$(/usr/libexec/java_home -v 1.7) java -version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment