A command line approach (thanks to the Homebrew team and the hard work of @vladimir-kempik and other openjdk contributors on the JEP-391 branch)

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install OpenJDK
brew install openjdk

Verify it's installed:

$(brew --prefix openjdk)/bin/java --version

Verify it's for the arm64 hardware:

file $(brew --prefix openjdk)/bin/java     
# /opt/homebrew/opt/openjdk/bin/java: Mach-O 64-bit executable arm64

Note: To install openjdk system-wide, follow the on-screen instructions provided by Homebrew.

Answer from tresf on Stack Overflow
Top answer
1 of 16
211

A command line approach (thanks to the Homebrew team and the hard work of @vladimir-kempik and other openjdk contributors on the JEP-391 branch)

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install OpenJDK
brew install openjdk

Verify it's installed:

$(brew --prefix openjdk)/bin/java --version

Verify it's for the arm64 hardware:

file $(brew --prefix openjdk)/bin/java     
# /opt/homebrew/opt/openjdk/bin/java: Mach-O 64-bit executable arm64

Note: To install openjdk system-wide, follow the on-screen instructions provided by Homebrew.

2 of 16
127

Yes.

On this page: AdoptOpenJDK Latest Releases you can select 'macOS' from the 'Operating System' dropdown, and then from 'Architecture', it's currently only x64, but soonish there should be AArch64 or ARM64 (those are usually the shortcodes for 64-bit ARM). Possibly, as Apple no doubt has a bunch of extensions built into their M1 designs, and Apple gets its own.

If you instead leave Operation System on 'any', you'll note aarch64 is in there, and this gets you to a Linux release for ARM processors. That (probably) won't run on macOS on M1 hardware, but that's 95% of the work already done.

So: It's not there yet, but note that JDKs for ARM have been available for more than decade, and whilst JDK 15 has dropped support for a bunch of exotic OS/architecture combinations (such as Solaris), ARM development has always remained at least partially relevant (even if so far it's mostly an Oracle commercial license offering). That is to say: It should not be a herculean effort to create an adoptopenjdk release that runs on M1s natively, so presumably, it will happen. But, it's an open source effort, so if you're anxious, by all means, read up and contribute :)

Apple has not given any details on this architecture whatsoever until November 10th 2020, unless you bought a development kit box for it (a Mac Mini with an A14 chip, which isn't an M1 chip, but close enough I guess), and signed a big NDA.

As a rule, open source projects will run as fast as possible in the opposite direction if you wave an NDA around, so if you dislike this state of affairs, I don't think it's wise to complain to adoptopenjdk or other packagers and open source projects about it :)

Fortunately, now it's out, and an NDA is no longer required. My assumption is that the ARM branch of the OpenJDK source code + the macOS bits that already exist for the macOS x64 release can be combined rather easily once someone with some familiarity with the OpenJDK source code has an M1-based macOS system to test it on, which should mean an adoptopenjdk macos-aarch64 release should be here within the month.

But, open source. You didn't pay them, you have no contract, and they don't owe it to you. Donate to the effort or contribute a pull request if you want it to go faster.

UPDATE:

  • Azul's M1 OpenJDK builds
  • Microsoft's (yes, really) GitHub source repo for an early access OpenJDK16 build for macOS on AArch64. Note that Microsoft's been working on the OpenJDK branch of AArch64 (for ARM-based Windows 10) for a while, which goes back to: A lot of the hard work was already done.
🌐
Reddit
reddit.com › r/macos › oracle released native apple silicon java jdk 17
r/MacOS on Reddit: Oracle released native Apple Silicon Java JDK 17
September 22, 2021 -

Just JDK 17 for now but it's a start:
https://www.oracle.com/java/technologies/downloads/#jdk17-mac

Many apps require Java. You might need some tweaking with apps which complain about version 8 or 11 by editing universalJavaApplicationStub in your App content and adding something like:

export JAVA_HOME=$(/usr/libexec/java_home -v11)

Basically you need to trick the app it's using an older version of Java.

Discussions

macOS - How to install Java 17 - Stack Overflow
Could someone please let me know the steps to install Java on a Mac. I did brew install java I get this Warning: openjdk 17.0.1 is already installed and up-to-date. To reinstall 17.0.1, run: brew More on stackoverflow.com
🌐 stackoverflow.com
How to install java on Mac m1?
I read somewhere last week that there is a new M1 version of Java runtime coming. But I could not find it today when I searched. More on reddit.com
🌐 r/MacOS
15
6
September 29, 2021
Java on MacBook with M1 chip
https://www.azul.com/downloads/ the arch ARM 64 is for Apple Silicon. Something that was really helpful for me was installing SDKMAN and with that installing the java version that was looking for. Both methods work, but the installation with SDKMAN fixed for me some issues related to java_home. More on reddit.com
🌐 r/javahelp
6
2
January 31, 2022
Java development on new Apple M1 chip

The M1 is just stupid fast, even with a stock oracle VM running with Rosetta emulation. A friend of mine got an M1 macbook air and I had him run the scimark2 benchmark on it. It was as fast as my Linux AMD Ryzen 9 3900X scimark2 results.

More on reddit.com
🌐 r/java
22
14
November 30, 2020
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › install › installation-jdk-macos.html
5 Installation of the JDK on macOS - Java
April 21, 2026 - The JDK supports both Intel-based (x64) and Apple Silicon (AArch64) Mac computers.
Top answer
1 of 13
407

In 2024, even if you can use just brew..

Copybrew install openjdk@17 

Java will be installed here:

Copy/opt/homebrew/opt/openjdk@17/bin/java

for Apple Intel path is /usr/local/... rather than /opt/homebrew/...

For the system Java wrappers to find this JDK, symlink it with:

Copysudo ln -sfn /opt/homebrew/opt/openjdk\@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

resp. for Intel

Copysudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Now, running /usr/libexec/java_home -V should show the path to JAVA 17, something like:

Copy17.0.9 (x86_64) "Homebrew" - "OpenJDK 17.0.9" /opt/homebrew/Cellar/openjdk@17/17.0.9/libexec/openjdk.jdk/Contents/Home

(This is what you are missing btw, if javac or javac --version does not give you a command-not-found but an The operation couldn’t be completed. Unable to locate a Java Runtime.)

In case you see the wrong version, check if the path to JAVA_HOME is set correctly. If not, you could set it by:

Copyexport JAVA_HOME=\$(/usr/libexec/java_home)

...give a try to sdkman, it's far better than brew

Copycurl -s "https://get.sdkman.io" | bash

then open a new shell and try list to see what you could install ;-)

Copysdk list java 

At time of writing you could use:

Copysdk install java 17.0.4.1-tem

Java will be installed here:

Copy/Users/YOUR_USERNAME_HERE/.sdkman/candidates/java/17.0.4.1-tem
2 of 13
56

Java doesn't mind if you install multiple versions. This is often required; java is not backwards compatible (it tries to change little, but e.g. the java8 to java9 transition broke a ton of stuff, much of it needless and much of it not reasonably expectable or fixable by libraries and apps, so a bunch of java apps and libraries only run on java8 - just an example).

So, yes, you have installed JDK17. Also, yes, if you just run java without specifying which one you want, you so happen to get java13 here.

To see all installed javas, you can run:

Copy/usr/libexec/java_home -V

to 'override', you can use something like (depends on which shell you're using on your mac):

Copyexport JAVA_HOME=`/usr/libexec/java_home -v 17`

(the backticks mean: Run this then take the output of it and treat that as the 'value' of the expression. here, assign it to the JAVA_HOME env var. -v 17 requests a path to java 17. The -V option lists all and is meant for your eyeballs, not for scripts. The -v option is mostly for scripting, and that's how we're using it here).

JAVA_HOME decides which java is used by some things, but the java you get when you just type java is /usr/bin/java, and that executable is actually just a wrapper that picks a java to run from amongst all installed versions. It uses JAVA_HOME to decide which java to actually run. There are wrappers for all the common commands (javac, too). You can always run e.g. which javac to see what that actually runs; you probably see /usr/bin/javac. Everything in /usr/bin is one of these wrapper thingies that looks at JAVA_HOME and then runs the binary it finds there.

🌐
Mac Performance Guide
macperformanceguide.com › blog › 2021 › 20211216_1200-Java-for-M1-Macs.html
Java for Apple M1 Macs
There appear to be two primary Apple ARM (M1) JDKs available today. Open JDK 17 is the latest release of Java. Download "macOS / AArch64" version.
🌐
Medium
medium.com › @idosinchuk › install-azul-zulu-jdk-17-on-apple-silicon-mac-m1-b6125938a823
Install Azul Zulu JDK 17 on Apple Silicon | Mac M1 | by Igor Dosinchuk | Medium
October 19, 2022 - Install Azul Zulu JDK 17 on Apple Silicon | Mac M1 In this article, I am going to show you how to install the JDK 17 on any Apple Silicon. For this article, I am going to use the Zulu JDK provided by …
Find elsewhere
🌐
Medium
sudarakayasindu.medium.com › installing-openjdk-on-m1-macbook-pro-4188ce3f9cf0
Installing OpenJDK on M1 Macbook Pro | by Sudaraka Jayathilaka | Medium
June 19, 2023 - openjdk: stable 16.0.1 (bottled) ...dk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk This is a beta version of openjdk for Apple Silicon (openjdk 17 preview).openjdk is keg...
🌐
javathinking
javathinking.com › blog › java-jdk-for-the-apple-silicon-chips
OpenJDK for Apple Silicon M1: Do You Need a Special Release? Where to Download — javathinking.com
OpenJDK compatibility with Apple Silicon depends on the JDK version: Key Takeaway: Use JDK 17 or later for stable, performant native ARM64 support on M1/M2 Macs.
🌐
Mac Install Guide
mac.install.guide › java › apple-silicon
Java on Apple Silicon or Intel Macs · Mac Install Guide · 2026
Java runs on all Apple Silicon Macs, both under Rosetta (with an Intel build) and natively (with an ARM64 build). Native Java has been officially supported since JDK 17 and offers full performance and functionality.
🌐
Reddit
reddit.com › r/macos › how to install java on mac m1?
r/MacOS on Reddit: How to install java on Mac m1?
September 29, 2021 - Official Oracle JDK17 supporting M1 native can be found here: https://community.oracle.com/tech/apps-infra/discussion/4479447/oracle-jdk-8-on-apple-m1-macbook · EDIT: directl download link here: https://download.oracle.com/java/17/latest/jdk-17_macos-aarch64_bin.dmg ·
🌐
javathinking
javathinking.com › blog › jdk-17-install-mac
Installing JDK 17 on macOS: A Comprehensive Guide — javathinking.com
It introduces powerful features like sealed classes, pattern matching for switch statements, enhanced pseudo-random number generators, and improved performance. For macOS users, installing JDK 17 requires considering your system’s ...
🌐
BellSoft
bell-sw.com › announcements › 2021 › 03 › 12 › Liberica-on-Apple-Silicon
Liberica JDK offers native Java builds for Apple Silicon M1 | BellSoft Java
January 31, 2023 - As of January 2021, Liberica JDK runs natively on Macs powered by the first processor of Apple’s design specifically for Macintosh computers, M1. This feature applies to both LTS’s (8, 11, 17) and the current version. 18 months have passed since then. Apple extended the line of M1 processors, ...
🌐
rieckpil
rieckpil.de › home › java tutorials › java development on an apple sillicon (m1, m2, m3, arm64)
Java Development on an Apple Sillicon (M1, M2, M3, ARM64) | rieckpil
March 18, 2024 - For those lucky developers that have the chance to work and experiment with the GraalVM, the support for Apple M1 has also landed. With Apple’s Rosetta 2 emulation, we can also try to work with an x64 JDK build.
🌐
Oregon State University
blogs.oregonstate.edu › cornercase › 2022 › 04 › 21 › the-apple-m1-and-java
The Apple M1 and Java – Corner Case
Your chosen distro also must be compatible with ARM 64-bit v8 (as we discussed earlier, this is the M1 chip’s arch). For additional hardware support, we also want to include the Java FX package (aka JDK FX). For these reasons, I recommend the Azul Zulu Java 17 (LTS) with JDK FX package.
🌐
Oracle
java.com › en › download › apple.jsp
Download Java
» Java 是什么 » 删除旧版本 » Mac 常见问题 » 安全性 » Support » 其他帮助 · 此下载用于帮助那些需要使用 Java 在台式机和笔记本电脑上运行应用程序的最终用户。Java 8 与操作系统集成在一起以运行单独安装的 Java ...
🌐
Apple Support
support.apple.com › en-us › 106567
Java for Mac OS X 10.6 Update 17 - Apple Support
Java for Mac OS X 10.6 Update 17 delivers improved security, reliability, and compatibility by updating Java SE 6 to 1.6.0_65.
🌐
Cleverence
cleverence.com › articles › oracle-documentation › installation-of-the-jdk-and-the-jre-on-macos-4836
Install JDK and JRE on macOS (Apple Silicon & Intel): Complete Guide
February 1, 2026 - Some vendors still ship JRE builds (e.g., Temurin for certain versions), but a JDK LTS like 17 or 21 is the most flexible and future-friendly option. -Which Java version should I install for development? Pick a long-term support (LTS) release like Java 17 or 21 unless your project specifies otherwise. LTS versions receive security fixes for years and are widely supported across libraries and frameworks. -Apple Silicon or Intel: does the architecture matter?
🌐
Gunnar Morling
morling.dev › blog › running-jmc-on-apple-m1
Running JDK Mission Control on Apple M1 - Gunnar Morling
May 17, 2022 - "temurin-17.jdk" is my default JDK; it’s the Java 17 build provided by the Eclipse Temurin project for macOS/AArch64, i.e. the right one for the ARM chip of the M1 ("Apple silicon"). The error message isn’t overly helpful; after all, that referenced JDK works just fine for all my other ...