Created
May 8, 2014 04:57
-
-
Save warmwaffles/eef6ebe2c32555944e0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Useful for switching between java 1.6, 1.7, 1.8 etc... | |
# | |
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) | |
setjdk() { | |
export JAVA_HOME=$(/usr/libexec/java_home -v $1) | |
} | |
# Usage: | |
# ~ setjdk 1.7 | |
# ~ java -version | |
# ~ setjdk 1.8 | |
# ~ java -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment