Last active
August 29, 2015 13:58
-
-
Save berngp/9985410 to your computer and use it in GitHub Desktop.
Dealing with Java 8 and 7 in the same Environment.
This file contains hidden or 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
# snippet from my ~/.zshrc file. | |
export JAVA7_HOME="$(/usr/libexec/java_home -v 1.7)" | |
function with-jdk7 | |
{ | |
export JAVA_HOME="$JAVA7_HOME" | |
echo "$@" | |
$@ | |
} | |
export JAVA8_HOME="$(/usr/libexec/java_home -v 1.8)" | |
function with-jdk8 | |
{ | |
export JAVA_HOME="$JAVA8_HOME" | |
echo "$@" | |
$@ | |
} | |
# now you can do.. | |
# $ width-jdk7 scala | |
# $ width-jdk7 spark-shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
export JAVA7_HOME=
/usr/libexec/java_home -v 1.7