Install JDK on macOS 10.7+

Requirements: Homebrew

1. Install your favorite JDK version

brew tap adoptopenjdk/openjdk

brew cask install adoptopenjdk8
brew cask install adoptopenjdk9
brew cask install adoptopenjdk10
brew cask install adoptopenjdk11

2. Add to your .bash_profile or .bash_rc or .zshrc …

Adjust adoptopenjdk-8.jdk depending on your installed version.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

3. Finally

Run source ~/.bash_profile

Leave a Reply

Your email address will not be published. Required fields are marked *