Last active
January 2, 2016 22:48
-
-
Save RichardWarburton/8371927 to your computer and use it in GitHub Desktop.
Switching between Java versions
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
# Goes in ~/.bashrc | |
export JAVA8_HOME=<PATH TO JDK 8> | |
export JAVA7_HOME=<PATH TO JDK 7> | |
export JAVA6_HOME=<PATH TO JDK 6> | |
export JAVA_HOME=$JAVA6_HOME | |
function go8 { | |
export JAVA_HOME=$JAVA8_HOME | |
export PATH=$JAVA_HOME/bin:$PATH | |
} | |
function go7 { | |
export JAVA_HOME=$JAVA7_HOME | |
export PATH=$JAVA_HOME/bin:$PATH | |
} | |
function go6 { | |
export JAVA_HOME=$JAVA6_HOME | |
export PATH=$JAVA_HOME/bin:$PATH | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment