Skip to content

Instantly share code, notes, and snippets.

@quangson91
Created November 27, 2017 02:38
Show Gist options
  • Save quangson91/d00c45cdc53919858582ce81d56f9622 to your computer and use it in GitHub Desktop.
Save quangson91/d00c45cdc53919858582ce81d56f9622 to your computer and use it in GitHub Desktop.
Update JAVA_HOME with jvm
update_java_home() {
local java_version=`jenv version-name`
export JAVA_HOME="`/usr/libexec/java_home -v $java_version`"
}
update_java_home
@quangson91
Copy link
Author

In .zshrc or .bash_profile we add this line at the end of file:

source /path/to/updat_java_home.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment