Install JDK on macOS 10.7+

Requirements: Homebrew

1. Install your favorite JDK version

brew tap adoptopenjdk/openjdk

brew install --cask adoptopenjdk8
brew install --cask adoptopenjdk9
brew install --cask adoptopenjdk10
brew install --cask adoptopenjdk11
brew install --cask adoptopenjdk12
brew install --cask adoptopenjdk13
brew install --cask adoptopenjdk14
brew install --cask adoptopenjdk15
brew install --cask adoptopenjdk16

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

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

export JAVA_HOME="/usr/libexec/java_home -v 11"

3. Finally

Run source ~/.bash_profile

Leave a Reply

Your email address will not be published.