Skip to content

Instantly share code, notes, and snippets.

@jcpst
Created October 28, 2015 15:21
Show Gist options
  • Save jcpst/2b74f8c44ca453400b22 to your computer and use it in GitHub Desktop.
Save jcpst/2b74f8c44ca453400b22 to your computer and use it in GitHub Desktop.
switch JAVA_HOME
function use-jdk {
jdk=$(/usr/libexec/java_home $1)
sed -i "s/^JAVA_HOME=.*/JAVA_HOME=\"$jdk\"/" "~/.zprofile"
source .zshrc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment