Skip to content

Instantly share code, notes, and snippets.

@cadams500
Created February 17, 2014 01:59
Show Gist options
  • Save cadams500/9043392 to your computer and use it in GitHub Desktop.
Save cadams500/9043392 to your computer and use it in GitHub Desktop.
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