Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mac OS - Set JDK
alias jdkls='/usr/libexec/java_home -V 2>&1 | grep -E "\d.\d.\d_\d\d" | cut -d , -f 1 | colrm 1 4 | grep -v Home'
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
function setjdk() {
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