How to install JDK 11 on mac using Homebrew

Step 1. Install Homebrew (skip this step, if already installed)

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Refer for more details https://brew.sh/

Step 2. Update HomeBrew and add the casks tap of HomeBrew.

$ brew update
$ brew tap homebrew/cask-versions

Step 3. Install Version 11 of Java JDK.

$ brew cask install java11
$ java --version
-------------------------------------------------
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
-------------------------------------------------

Step 4. Install latest version of Java JDK.

$ brew cask install java
Author

Vaibhav Bhootna

Posted on

2020-10-26

Updated on

2020-11-02

Licensed under

Comments