Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup and Install JDK 8, 9, 10 in macOS with Homebrew

Oracle now force user to signup and accept the license agreement in the oracle website.

JDK 8 is still mostly used among java developer especially Android Developer.

Unfortunately, if we're on macOS there's a bad news that the homebrew community delete the entire JAVA/JDk cask and give replacement support to use AdoptOpenJDK.

brew tap adoptopenjdk/openjdk

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

Thanks to:

That's it!

#homebrew #macos #jdk #java #cask #setup #android-studio #android #gradlew

@dailyworker

This comment has been minimized.

Copy link

@dailyworker dailyworker commented Dec 14, 2019

Thanks!

@alouanemed

This comment has been minimized.

Copy link

@alouanemed alouanemed commented Oct 15, 2020

Error: Cask 'adoptopenjdk11' is unavailable: No Cask with this name exists.

@mochadwi

This comment has been minimized.

Copy link
Owner Author

@mochadwi mochadwi commented Oct 18, 2020

It's been while since I wrote this gist, looks like openjdk is used as cask now, instead of adoptopenjdk. Will check on it later @alouanemed

@alouanemed

This comment has been minimized.

Copy link

@alouanemed alouanemed commented Oct 18, 2020

To stay with a specific major release, activate the AdoptOpenJDK tap with brew tap and then install the desired version with brew cask install:

$ brew tap AdoptOpenJDK/openjdk
$ brew cask install <version>

To install AdoptOpenJDK 14 with HotSpot, run:

$ brew tap AdoptOpenJDK/openjdk
$ brew cask install adoptopenjdk14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment