Oracle has a poor record for making it easy to install and configure Java, but using Homebrew, the latest OpenJDK (Java 14) can be installed with:
brew install --cask adoptopenjdk8
For the many use cases depending on an older version (commonly Java 8), the AdoptOpenJDK project makes it possible with an extra step.
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists in multiple taps due to prior workarounds with different instructions. This can be solved by fully specifying the location with brew install --cask adoptopenjdk/openjdk/adoptopenjdk8.
Unable to install Java 8 on MBP M4
How can I install java openjdk 8 on High Sierra or newer macOS - Ask Different
java - Will x64 jdk-1.8 work in Mac with Apple Silicon (M1) Chip? - Stack Overflow
Java on Macbook Air (MacOs Sierra) not possible?
Videos
Oracle has a poor record for making it easy to install and configure Java, but using Homebrew, the latest OpenJDK (Java 14) can be installed with:
brew install --cask adoptopenjdk8
For the many use cases depending on an older version (commonly Java 8), the AdoptOpenJDK project makes it possible with an extra step.
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists in multiple taps due to prior workarounds with different instructions. This can be solved by fully specifying the location with brew install --cask adoptopenjdk/openjdk/adoptopenjdk8.
Note: Oracle Java 8/9/10 is no longer available for public download (license change).
First install and update brew from Terminal:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap homebrew/cask-versions
brew update
NEW as of June 2019
To install the JDKs from AdoptOpenJDK:
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
brew install --cask adoptopenjdk9
brew install --cask adoptopenjdk10
brew install --cask adoptopenjdk11
OLD
Java 8:
brew install --cask java8
Java Latest:
brew install --cask java
Hello,
I need Java for some applications and I just downloaded the latest Java installer (jre-8u431-macosx-aarch64) from Oracle aaand … it's not installing. It tries to install and says something like java could not be installed and "OS error code 1".
I searched for hours on Google and couldn't find anything. Did anyone have a solution to this? I'm running Sequoia 15.2.
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 install --cask adoptopenjdk
To install a specific version
brew tap AdoptOpenJDK/openjdk
brew install --cask adoptopenjdk8
brew install --cask adoptopenjdk9
Manual Solution
If you are looking to just bring down the binary without actually installing it, simply navigate to https://adoptopenjdk.net
I found this is the easiest way to download and install. Navigate here and choose platform.
Homebrew does not support OpenJDK@8 on Apple Silicon (M1/M2) but Zulu Community 8 is present as a cask. You just have to enable cask-versions repository and install zulu8 cask.
Copybrew tap homebrew/cask-versions
brew install --cask zulu8
It will install the JDK in /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home. You should then configure your JAVA_HOME variable for development tools to use it.
Copyexport JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Please note that Zulu Community 8 will only be supported until March 2026.
Rosetta 2
You can run Java for Intel Macs on Apple Silicon (ARM, Aarch64) via Rosetta 2.
Choice of JDK vendors
But for maximum performance, obtain an implementation of Java 8 built for Apple Silicon Macs.
Arm64 jdk-8 is currently unavailable currently.
Not true.
You have a choice of JDK vendors.
I know Azul Systems provides JDK products for Java 8 on both Mac’s with Intel and Macs with Apple Silicon M1/M2/M3.
Try these vendors providing JDK products, to see if they offer Java 8 on Apple Silicon Macs:
- Adoptium
- Azul Systems
- Microsoft
- Amazon
- SAP
- BellSoft
- Oracle
- IBM
- Red Hat
- … and more
SDKMAN!
I enjoy using the console app SDKMAN! to easily find, download, install, and uninstall JDKs from a subset of the vendors listed above.
Works with simple command-line instructions such as:
Copysdk list java
… and:
Copysdk install java specific_product_identifier_pasted_here
I tested this answer using a clean install of High Sierra 10.13.6. All updates from Apple were installed.
The downloads of the JDKs can be found at Java Downloads. I could not correctly view this site using Safari under High Sierra. Instead, I installed and used Firefox ESR (Extend Support Release). This link for Firefox download can be successfull viewed from Safari. The file I downloaded and installed was Firefox 115.16.1esr.dmg.
I tried JDK 23 by downloading and installing jdk-23_macos-x64_bin.dmg. This was not recognized by Java. Next, I tried JDK 21 by downloading and installing jdk-21_macos-x64_bin.dmg. This was recognized by Java.
Instructions for uninstalling a JDK can be found here. Personally, I just used the Finder to move the /Library/Java/JavaVirtualMachines/jdk-23.jdk folder to the Trash.
I tested by using the simple code given below. The code was stored in the file named Simple.java.
class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
Example of testing is given below.
dmas-Mac:Desktop dma$ javac Simple.java
dmas-Mac:Desktop dma$ java Simple
Hello Java
BTW, I tested JDK 23 using macOS Monterey and did not encounter the problems that occurred with High Sierra.
I've successfully installed Java 21 from Microsoft on High Sierra.
$ java --version
openjdk 21.0.8 2025-07-15 LTS
OpenJDK Runtime Environment Microsoft-11933195 (build 21.0.8+9-LTS)
OpenJDK 64-Bit Server VM Microsoft-11933195 (build 21.0.8+9-LTS, mixed mode, sharing)
Java 25 has the some issue as mentioned above. It looks like the jdks have been build with a dependency to "chkstk_darwin" which ist not available in High Sierra.