Last active
August 29, 2015 13:57
-
-
Save xemoe/9848169 to your computer and use it in GitHub Desktop.
Java use multi version
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
alias java_ls='/usr/libexec/java_home -V 2>&1 | grep -E "\d.\d.\d_\d\d" | cut -d , -f 1 | colrm 1 4 | grep -v Home' | |
function java_use() { | |
export JAVA_HOME=$(/usr/libexec/java_home -v $1) | |
export PATH=$JAVA_HOME/bin:$PATH | |
java -version | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment