Installing the Java SDK on a Mac
There are also many ways to install the Java SDK on a Mac. One of the easiest ways is to use Homebrew. Homebrew is an open source software package management system that simplifies software for installation for Mac users.
Using Homebrew to install OpenJDK 11 on a Mac
OpenJDK 11 is available as a binary package and is supported for both Intel and Apple Silicon Macs.
To check the Homebrew formulae and install the JDK, perform the following steps:
- Validate the version and supported platforms for OpenJDK 11 from the Homebrew page: https://formulae.brew.sh/formula/openjdk@11. Copy the Install command value from that page as well:
Figure A.23 – OpenJDK@11 Homebrew formulae
- Run
brew install openjdk@11
on a Mac terminal:
Figure A.24 – Installing OpenJDK 11 using homebrew
- Check whether the install completed successfully: