Java 17, shipped 2021-09

There is an official sub-project on the OpenJDK project for porting to the Apple Silicon hardware, JEP 391: macOS/AArch64 Port.

That work is done, built for Java 17, delivered in September of 2021.

The Apple Silicon port benefits from work done on the Windows on ARM port. That work is done, delivered in Java 16. Previous to that, Linux on ARM support was added to Java 9.

👉 So Java 17 for macOS on Apple Silicon (AArch64, ARM) Macs is available now.

Update: Java 18 is now available too, as is early access Java 19.

You can choose from a variety of vendors to obtain an installer/binary. Off the top of my head, those may include Azul Systems, SAP, BellSoft, Amazon, Microsoft, Adoptium (formerly AdoptOpenJDK), Oracle, Red Hat/IBM, Pivotal, and perhaps more.

Regarding JavaFX, at least two of those vendors, Azul Systems and BellSoft, offer an edition of their JDK product that bundles the OpenJFX libraries. That may be of interest to you, as an alternative to adding the libraries to your app.

If you need further assistance with that Azul product, you can purchase support from that company. Or post a Question here with the detailed specifics of your JavaFX work and its point of failure on Apple Silicon. Ideally, provide a minimal example of code demonstrating the problem.

Earlier Java

Some of those vendors listed above have back-ported earlier versions of Java (Java 8, Java 11, maybe others) to macOS on Apple Silicon. That work is not an official part of the OpenJDK project support for Apple Silicon, only Java 17+ is.

Answer from Basil Bourque on Stack Overflow
🌐
GitHub
github.com › AdoptOpenJDK › homebrew-openjdk › issues › 530
Provide native builds for M1 Apple Silicon (ARM) Macs in Homebrew · Issue #530 · AdoptOpenJDK/homebrew-openjdk
May 3, 2021 - AdoptOpenJDK now includes a build for the new M1-based (Apple Silicon) Macs. Ideally, the Homebrew package should provide this ARM based build when being installed on an Apple Silicon Mac rather than relying on Rosetta 2 to run the JDK. ...
Author   AdoptOpenJDK
Top answer
1 of 2
11

Java 17, shipped 2021-09

There is an official sub-project on the OpenJDK project for porting to the Apple Silicon hardware, JEP 391: macOS/AArch64 Port.

That work is done, built for Java 17, delivered in September of 2021.

The Apple Silicon port benefits from work done on the Windows on ARM port. That work is done, delivered in Java 16. Previous to that, Linux on ARM support was added to Java 9.

👉 So Java 17 for macOS on Apple Silicon (AArch64, ARM) Macs is available now.

Update: Java 18 is now available too, as is early access Java 19.

You can choose from a variety of vendors to obtain an installer/binary. Off the top of my head, those may include Azul Systems, SAP, BellSoft, Amazon, Microsoft, Adoptium (formerly AdoptOpenJDK), Oracle, Red Hat/IBM, Pivotal, and perhaps more.

Regarding JavaFX, at least two of those vendors, Azul Systems and BellSoft, offer an edition of their JDK product that bundles the OpenJFX libraries. That may be of interest to you, as an alternative to adding the libraries to your app.

If you need further assistance with that Azul product, you can purchase support from that company. Or post a Question here with the detailed specifics of your JavaFX work and its point of failure on Apple Silicon. Ideally, provide a minimal example of code demonstrating the problem.

Earlier Java

Some of those vendors listed above have back-ported earlier versions of Java (Java 8, Java 11, maybe others) to macOS on Apple Silicon. That work is not an official part of the OpenJDK project support for Apple Silicon, only Java 17+ is.

2 of 2
1

Adoptium recently (2022-Oct-22) released Java 11 that supports Apple Silicon:

https://adoptium.net/temurin/releases/?version=11

And for a summary of supported platforms:

https://adoptium.net/supported-platforms/

Discussions

macos - Java/JDK for the Apple Silicon chips - Stack Overflow
Will there need to be a special release of OpenJDK to support the new Apple Silicon chips? I see that there are currently downloads of the JDK for macOS/OS X, but these seem to only be for x86 proc... More on stackoverflow.com
🌐 stackoverflow.com
Provide native builds for ARM based Macs
At WWDC20 Apple announced to move from Intel to ARM chips for Mac hardware. For the Java Community it will be important to support Java on those new devices. At Adopt we should provide native Java ... More on github.com
🌐 github.com
45
June 23, 2020
java - How to compile OpenJDK 11 on an M1 Macbook? - Stack Overflow
Java 17 was released 2021-09. OpenJDK officially supports macOS on Apple Silicon: JEP 391: macOS/AArch64 Port. You have your choice of builds/installers from any of several vendors such as SAP, Red Hat/IBM, BellSoft, Azul Systems, Oracle, Adoptium/AdoptOpenJDK, Microsoft, Amazon, Pivotal, and more. More on stackoverflow.com
🌐 stackoverflow.com
macos - How to install Java 8 on Mac - Stack Overflow
Editors note: This question was asked in 2014, and the answers may be outdated. I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS X 9 More on stackoverflow.com
🌐 stackoverflow.com
🌐
Reddit
reddit.com › r/java › how about jvm/jdk on apple silicon ? good / bad for java ?
r/java on Reddit: How about JVM/JDK on Apple Silicon ? good / bad for Java ?
June 22, 2020 - We continue to tweak the port, but I doubt that Apple CPUs will require anything substantial. Apple have said that they're working on OpenJDK, but they haven't contacted us yet. ... It sounds like there are going to be developer mac mini's available. Does anyone know if adoptOpenJdk is going ...
🌐
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
Several trusted vendors provide native ARM64 OpenJDK builds for macOS. Below are the most reliable options: Adoptium (formerly AdoptOpenJDK) is a leading provider of free, open-source OpenJDK binaries.
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.
🌐
Carleton
wiki.carleton.edu › display › itskb › All+About+Java+AdoptOpenJDK
All About Java AdoptOpenJDK - ITS - Carlpedia - Carleton College Wiki
February 17, 2022 - Skip to content · Skip to breadcrumbs · Skip to header menu · Skip to action menu · Skip to quick search · Browse pages · ConfigureSpace tools · Attachments (0) · Page History · Resolved comments
🌐
Does It Arm
doesitarm.com › formula › openjdk
Does openjdk work on Apple Silicon? - Does It ARM
Latest reported support status of openjdk on Apple Silicon and Apple M3 Max and M2 Ultra Processors.
Find elsewhere
🌐
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 - There’s no difference in the installation process of a JDK compared to an x64 Mac. Once we’ve downloaded and installed a compatible JDK build, we have the baseline for our Java development for our Apple M1:
🌐
GitHub
github.com › adoptium › temurin-build › issues › 1922
Provide native builds for ARM based Macs · Issue #1922 · adoptium/temurin-build
June 23, 2020 - At WWDC20 Apple announced to move from Intel to ARM chips for Mac hardware. For the Java Community it will be important to support Java on those new devices. At Adopt we should provide native Java ...
Author   adoptium
🌐
Medium
shift.infinite.red › dont-use-the-wrong-jdk-for-react-native-if-you-re-using-an-m1-mac-252533dd47a2
[OUTDATED] Don’t use the wrong JDK for React Native if you’re using an M1 Mac | by Jamon Holmgren | Red Shift
September 9, 2022 - While we are still working on updates ... Apple Silicon / arm64 compatible JDK. Pretty much every “Installing React Native on Apple M1” guide out there contains these instructions: # (if you're lazy and not reading my article, # don't actually run this please) 😂 brew install --cask adoptopenjdk/openjdk/a...
🌐
Azul
azul.com › home › press releases › azul announces support of java builds of openjdk 8, 11, 13, and 15 for apple silicon
Azul Announces Support of Java Builds of OpenJDK 8, 11, 13, and 15 for Apple Silicon
November 18, 2025 - Azul has been leading the OpenJDK community effort (JEP 391) initiated in August 2020, to add support for Apple Silicon, Arm-based Macs in future versions of OpenJDK.
Top answer
1 of 4
16

tl;dr

target (64) differs … number of bits … in the target (32)

Apple Silicon chips for macOS (M1, M2) are all 64-bit architectures. Do not compile for 32-bit.

I want to compile jdk in M1 MacBook.

Do not try to compile OpenJDK. Codebase is large and complicated. And no need, as others provide binaries & installers.

For a Mac using Apple Silicon rather than Intel x86-64, I suggest obtaining a distribution of Java 17 for macOS / AArch64, released 2021-09, from any of several vendors.

Or, use a build of earlier versions of Java ported to Apple Silicon by various vendors. For example, Azul Systems announced 2020-11 plans to ship builds of OpenJDK 8 and 11 for Apple Silicon, ARM-based Macs. I see downloads available now from that company for Java 11.0.13+8 on both Intel Macs and Apple Silicon Macs.

Details

Few of us ever compile the very large and complicated codebase of OpenJDK. Instead, we look to any of several vendors providing builds and installers. If your goal is to be productive in Java programming, then compiling the Java JDK toolset is not the best use of your time.

Java 17 was released 2021-09. OpenJDK officially supports macOS on Apple Silicon: JEP 391: macOS/AArch64 Port. You have your choice of builds/installers from any of several vendors such as SAP, Red Hat/IBM, BellSoft, Azul Systems, Oracle, Adoptium/AdoptOpenJDK, Microsoft, Amazon, Pivotal, and more. These builds/installers will be based largely or entirely on the OpenJDK codebase.

Vendors such as Azul Systems provide Apple Silicon builds for the current version 19 as well as the long-term support (LTS) versions 8, 11, and 17. Java 17 is the latest LTS version, to be supported for many years. So I would suggest Java 17 for deployment.

I myself have been using Java 17, 18, and 19, as well as early-access 20, on a couple of M1 MacBook Pro laptops with IntelliJ and Maven on Big Sur & Monterey. Working well, no problems.

Update: As of 2023-11, I would suggest the current version 21 for deployment, as it is the latest LTS version. Also, you can now obtain JDK binaries and installers from many vendors, including Amazon, Microsoft, Azul Systems, BellSoft, Oracle, Adoptium, SAP, IBM, Red Hat, Linux apt-get, FreeBSD Ports and Packages, and more. Most of these provide editions of their JDK products for both Intel Macs and Apple Silicon Macs.

Compiling Java

As commented, your specific error is likely due to you compiling for 32-bit ARM rather than 64-bit ARM architecture used by Apple for their M1 chip and M2 chip families.

If you are curious about, or have an academic interest in compiling Java from the OpenJDK codebase, I suggest examining the open-sourced tooling at Adoptium (formerly AdoptOpenJDK). The tooling for building early-access builds at the OpenJDK site may also be open-sourced but I don’t know for certain.

2 of 4
5

You can build OpenJDK 11.0.12 on an M1 MacBook, with the help of Homebrew, by running:

brew install --build-from-source --verbose openjdk@11

Xcode is a prerequisite, you can download it from there https://developer.apple.com/download/more/ (Apple ID needed).

You probably also have to run:

xcode-select --install
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

I've tested it and it builds perfectly.

🌐
Reddit
reddit.com › r/java › openjdk 16 ea for mac os on apple silicon
r/java on Reddit: OpenJDK 16 EA for Mac OS on Apple Silicon
November 13, 2020 - You might be able to attempt to recompile on ARM. Worst-case you’ll end up compiling for Rosetta 2 which from what I understand has comparable performance to the same low-end Macs Apple is replacing with the ArmBooks.
🌐
Adoptium
adoptopenjdk.net › releases.html
Latest release | AdoptOpenJDK - Open source, prebuilt OpenJDK binaries
AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.
🌐
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...
🌐
Medium
erwinschleier.medium.com › install-jdk-8-and-setup-java-home-on-mac-m1-1b0ea243b05a
Install JDK 8 and Setup JAVA_HOME on Mac M1 | by Erwin Schleier | Medium
November 14, 2023 - brew tap adoptopenjdk/openjdk && brew install --cask adoptopenjdk8 · And finally you can install JDK8. Therefore go to: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk scroll down and download the .dmg file than execute it.
🌐
GitHub
github.com › gradle › gradle › issues › 19595
Run build failed on apple silicon chips as ADOPTIUM not being avaliable · Issue #19595 · gradle/gradle
January 18, 2022 - Blocked on download ADOPTIUM or ADOPTOPENJDK failures. See square/okhttp/issues/6943. After I bumped Gradle to 7.4-rc-1, it still not works. See Goooler/okhttp/pull/25. MacBook Pro 14-inch with Apple M1 Pro openjdk version "11.0.13" 2021-10-19 LTS OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS) OpenJDK 64-Bit Server VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)
Author   gradle