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.
macos - How to install Java 8 on Mac - Stack Overflow
java - Will x64 jdk-1.8 work in Mac with Apple Silicon (M1) Chip? - Stack Overflow
How to install java on Mac m1?
Java on Macbook with M1 chip
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
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