37

How do I install OpenJDK 8 on High Sierra or newer macOS?

It looks like support for the Java Oracle JDK version 8 will be deprecated after January 2019 Java SE Overview

Additionally, it looks like publishing and distributing Docker containers with the Oracle Java JDK may not be legal Running Java on Docker

0
70

Fastest Solution

Use the adoptopenjdk cask

See also https://discourse.brew.sh/t/how-to-install-openjdk-with-brew/712/4

To install latest:

brew cask install adoptopenjdk

To install a specific version

brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
brew cask install adoptopenjdk9

Manual Solution

If you are looking to just bring down the binary without actually installing it, simply navigate to https://adoptopenjdk.net

3
  • 4
    The cask route didn't actually install the JDK but just downloaded the .pkg file where I had to manually navigate to it and run the installer. – micker Aug 30 '19 at 13:14
  • When I install it this way manually, it asks for a sudo password. This might be the reason it does not work using Ansible. – Günter Zöchbauer Apr 10 '20 at 5:55
  • 5
    brew cask install adoptopenjdk8 no longer works. This is the correct path: brew cask install adoptopenjdk/openjdk/adoptopenjdk8 – Prajwal Sep 4 '20 at 5:30
6

I found this is the easiest way to download and install. Navigate here and choose platform.

0
3

You can also install openjdk from Zulu, a commercial vendor that builds and releases OpenJDK free of charge here

You can just manually install it from the above link!

1
  • that says "macOS 10.13 or later" – denis Sep 13 '19 at 10:08
2

Upon running

brew cask install adoptopenjdk8

If you get this error

Error: Unknown command: cask

With the newer versions of brew, cask won't work like this anymore.

Use:

brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk8 --cask
New contributor
CodeShadow is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Not the answer you're looking for? Browse other questions tagged .