Skip to content

Instantly share code, notes, and snippets.

@ashimjk
Last active April 24, 2020 19:11
Show Gist options
  • Save ashimjk/e6c0cdb9ac19e21ece2e221ee22ac21b to your computer and use it in GitHub Desktop.
Save ashimjk/e6c0cdb9ac19e21ece2e221ee22ac21b to your computer and use it in GitHub Desktop.
# Note
# On Mac OSX, Java should installed in this folder; it is Mac’s standard.
/Library/Java/JavaVirtualMachines/
# Update repo
brew update
# Add adoptopenjdk/openjdk
brew tap adoptopenjdk/openjdk
# Find all available JDK.
brew search jdk
# Install JDK
brew cask install adoptopenjdk8
# JDK will installed in
/usr/libexec/java_home -V
# Now Homebrew will install the JDK at folder /Library/Java/JavaVirtualMachines/
# If we install multiple version of jdk, by default, Mac takes the highest version.
# In .bash_profile, add following code
export JAVA_HOME_8=$(/usr/libexec/java_home -v1.8)
# Java 8
export JAVA_HOME=$JAVA_HOME_8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment