Skip to content

Instantly share code, notes, and snippets.

@ashimjk
Created April 24, 2020 18:27
Show Gist options
  • Save ashimjk/88e023043c3e4fe5f78150c4fe4f3873 to your computer and use it in GitHub Desktop.
Save ashimjk/88e023043c3e4fe5f78150c4fe4f3873 to your computer and use it in GitHub Desktop.
# For switch jdk, we can use jEnv (https://www.jenv.be/)
# This is for manual
# Export JAVA_HOME from .bash_profile
vim ~/.bash_profile
# In .bash_profile, add following code
export JAVA_HOME_8=$(/usr/libexec/java_home -v1.8)
export JAVA_HOME_11=$(/usr/libexec/java_home -v11)
# Java 8
export JAVA_HOME=$JAVA_HOME_8
# Java 11
# export JAVA_HOME=$JAVA_HOME_11
# Reload profile
source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment