Skip to content

Instantly share code, notes, and snippets.

@mochadwi
Created November 21, 2019 11:14
Show Gist options
  • Save mochadwi/7036d164e5840361701ef90276d23af1 to your computer and use it in GitHub Desktop.
Save mochadwi/7036d164e5840361701ef90276d23af1 to your computer and use it in GitHub Desktop.
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

@alouanemed
Copy link

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

@mochadwi
Copy link
Author

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
Copy link

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