Take a look at how you can quickly get started with OpenJDK with this tutorial that gives you commands for installing version 7-11 through a Mac Terminal.
Mar 13, 2019.
Join the DZone community and get the full member experience.
Join For FreeIn this article, I will be using Homebrewto install OpenJDK versions on the Mac.
We use brew install
to install JDK versions 8,9,10, andbrew cask install
for version 11 and above.
All the brew commands are executed in the Terminal window on the Mac.
Install OpenJDK Versions 8, 9, and 10
brew tap AdoptOpenJDK/openjdk
brew search /adoptopenjdk/
The Formulae section contains the identifiers for the various JDK versions.
To install a specific JDK version: brew install <identifier>
Brew Java 8
e.g. to install OpenJDK 8: brew install adoptopenjdk/openjdk/adoptopenjdk-openjdk8
JAVA_HOME should be set by the developer to /usr/local/Cellar/adoptopenjdk-openjdk8/jdk8u172-b11.
Install OpenJDK Version 11
brew cask install adoptopenjdk
JAVA_HOME should be set by the developer to /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk.
Mac Os Install Java 8 Brew
Java 8 Download For Mac
Opinions expressed by DZone contributors are their own.