Factsheet
java - Will x64 jdk-1.8 work in Mac with Apple Silicon (M1) Chip? - Stack Overflow
java - Homebrew : Error: openjdk@8: no bottle available - Stack Overflow
How can I install java openjdk 8 on High Sierra or newer macOS - Ask Different
current main doesn't compile anymore
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
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.
Editors note: This answer is outdated as the PPA’s listed are not available anymore.
You can do this for;
Final Update
JDK
sudo apt-get install openjdk-8-jdk
JRE
sudo apt-get install openjdk-8-jre
Old Update
I found two repository but I do not recommend
OpenJDK builds (all archs)
ppa:openjdk-r/ppaOpenJDK 8 backport for trusty
ppa:jochenkemnade/openjdk-8
Original Message
If you really want to use OpenJDK, you have to compile from source. There is not still any PPA for OpenJDK.
It has been requested at https://bugs.launchpad.net/ubuntu/+bug/1297065
I recommend you to use Webup8 Oracle Java8 Installer
Note: WebUpd8 team's PPA has been discontinued with effective from April 16, 2019. Thus this PPA doesn't have any Java files. More information can be found on PPA's page on Launchpad. Hence the below method no longer works and exists because of historical reasons.
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
To automatically set up the Java 8 environment variables
sudo apt-get install oracle-java8-set-default
Check it
java -version
So you have to wait to use OpenJDK8
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo update-alternatives --config java
sudo update-alternatives --config javac