Last active
January 9, 2018 22:07
-
-
Save Noyabronok/0a90e1f3c52d1aaa941013d3caa8d0e4 to your computer and use it in GitHub Desktop.
JDK switching
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
#list available jdks | |
alias jdks="/usr/libexec/java_home -V" | |
# jdk version switching - e.g. `jdk 6` will switch to version 1.6 | |
function jdk() { | |
echo "Switching java version"; | |
export JAVA_HOME=`/usr/libexec/java_home -v 1.$1`; | |
java -version; | |
} | |
export PATH=\$JAVA_HOME/jre/bin:$PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment