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
210

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.
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › install › installation-jdk-macos.html
Installation of the JDK on macOS
July 15, 2025 - JDK is installed in /Library/Java/JavaVirtualMachines/jdk-<FEATURE>.jdk where <FEATURE> is the feature release number. For example, JDK 21.0.1 is installed in /Library/Java/JavaVirtualMachines/jdk-21.jdk. ... When starting a Java application through the command line, the system uses the default JDK.
🌐
Apple Community
discussions.apple.com › thread › 254771070
Java for m1/m2, apple silicon, amd64 on mac ventura 13.2.1
How can you get Java for Apple Silicon? The support website (Get Java for your Mac - Apple Support) links to Oracle, which provides an Intel-compatible Java only.
🌐
BellSoft
bell-sw.com › announcements › 2021 › 03 › 12 › Liberica-on-Apple-Silicon
Liberica JDK offers native Java builds for Apple Silicon M1 | BellSoft Java
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.
🌐
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...
🌐
Pangea.ai
pangea.ai › resources › setting-up-java-development-for-mac-m1
Setting up Java Development for Mac M1 | Pangea.ai
If you don't yet know whether you're a Z Shell user or a Bash user you can type echo $SHELL and look for the output of either: /bin/bash, or /bin/zsh. Next, we're going to edit the environment variables by typing either: ... We're going to add the Java home path to this file and set up the system path variable to allow our machine to find it. Using jdk1.8.0_291.jdk this will look something like this:
🌐
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. OpenJDK is what IntegrityChecker Java has long used on Intel Macs.
🌐
YouTube
youtube.com › watch
How to Install Java on Mac M1 / M2 / M3 | Install Java JDK on macOS (2024) - YouTube
In this tutorial, I'll show you how to install Java on a Mac with Apple Silicon (M1, M2, or M3 chip) running macOS. Whether you're a developer or just need J...
Published   November 8, 2024
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 - With Apple’s Rosetta 2 emulation, we can also try to work with an x64 JDK build. However, we may run into issues and/or won’t get the expected performance. What’s next is Docker.
🌐
OS X Daily
osxdaily.com › 2024 › 06 › 03 › how-install-java-mac-m3-m2-m1-apple-silicon
How to Install Java on Mac with M3, M2, M1 Apple Silicon Chip
May 31, 2024 - I just updated the Java on my Mac w/ Apple silicon M1 chip and OSX Sonoma 14.6.1 as instructed by OSXDaily. I’m trying to confirm the update via “Terminal application” commands, however, unlike the intuitive Win10 CMD access, I cannot locate the access for “Terminal” on this MacBook. Pls advise. Thanks. ... Developers and those who want to run a Minecraft server, can also manually browse to https://www.oracle.com/java/technologies/downloads/#jdk22-mac and get the ARM64 Compressed Archive or wget/curl the compressed tarball file, and unpack it, then browse to “/Library/Java/JavaVirtualMachines/” and plunk it there, it will prompt the system’s pass.
🌐
Reddit
reddit.com › r/javahelp › java on macbook with m1 chip
r/javahelp on Reddit: Java on MacBook with M1 chip
January 31, 2022 -

Hey, I don’t know which version of Java I have to download to get Java on my MacBook Pro with M1 chip. I need Java to use Scala in Intellij (it says to make sure I have the Java 8 JDK). I have tested in the terminal, that Java is not installed on my computer (I wrote java -version and javac -version). I hope someone can help :-)

Top answer
1 of 4
2
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.
2 of 4
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
🌐
Wiredverse
wiredverse.com › posts › running java jdk natively on apple m1 macs (apple silicon)
Running Java JDK natively on Apple M1 Macs (Apple Silicon) | Wired Verse
I recently moved from an i5 2018 ... Before I dig any deeper, you can absolutely go straight to the Azul download site and download the .dmg for Zulu Java JDK......
🌐
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. For ...
🌐
Reddit
reddit.com › r/javahelp › which java (jdk 21) is most preferred for macbook air?
r/javahelp on Reddit: Which Java (JDK 21) Is Most Preferred for MacBook Air?
January 17, 2024 -

I am currently taking an intro to Java class for college. I’m trying to download Java from oracle. I have a MacBook Air and my chip is an apple M2. Which download is preferred? I have four download options

  1. Arm 64 Compressed archive

  2. Arm 64 DMG Installer

  3. x64 Compressed Archive

  4. x64 DMG Installer

I just need help in order to begin the class. I will delete the post once I get the help. Please and thank you

🌐
Medium
medium.com › @aniketvishal › how-to-install-java-and-setup-java-home-path-in-macos-apple-silicon-m1-m2-2edf185b992c
How to install Java 21 and setup JAVA_HOME Path in macOS 🍏 (Apple Silicon) | by Aniket Vishal | Medium
October 22, 2024 - Apple Silicon Macs use a different architecture compared to their Intel-based predecessors. Therefore, you need to download a Java version that’s compatible with Apple Silicon. Open your web browser and open the Java Downloads section on Oracle website. Select the “Latest Java Release” for macOS.
🌐
Reddit
reddit.com › r/javahelp › setting up java on m1 mac
r/javahelp on Reddit: Setting up Java on M1 Mac
March 18, 2021 -

I'm absolutely new to Apple computers, and I recently bought an M1 MacBook Air.

I've been trying to setup Java JDK and JRE so I can use 'sudo apt' commands. I installed it directly from the Oracle website, but it still wouldn't let me run sudo apt commands (The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt)

I then found out about Azul, which has a version of JDK/JRE for the M1 architecture, so I went to their website and downloaded and installed the JDK and JRE for MacOS ARM 64. However, I still get the same error when I try to run the sudo apt command.

I'm very new to all this, should I be running the terminal in a specific folder or something? Any help would be appreciated, as I need this for my University work. Thanks!

🌐
YouTube
youtube.com › watch
How to Install Java JDK 24 on Mac (M1 / M2 / M3 / MacOS / Macbook) [2025] - YouTube
Learn how to install java jdk 24 on mac (mac m1 / m2 / m3 / m4 / macos / macbook air / pro / intel) & set java_home variable.Learn to install Java 24 (oracle...
Published   March 20, 2025
🌐
YouTube
youtube.com › watch
How To Install Java on Mac M1/M2: Complete Setup Tutorial - YouTube
This video shows how to download and install Java on Mac M1/M2 and configure .zshrc for environment variables. Suitable for Selenium and Java developers on m...
Published   September 14, 2023
🌐
Collabnix
collabnix.com › how-to-setup-java-on-apple-mac-m1-pro-in-2-minutes
How to setup Java on Apple Mac M1 Pro in 2 Minutes - Collabnix
The Eclipse Temurin binaries are ... for general use across the Java ecosystem. Follow the below steps to get OpenJDK installed in your macOS 12.4 Monterey: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ... $brew tap homebrew/cask-versions $sudo softwareupdate --install-rosetta $brew install --cask temurin8 $brew install --cask temurin11 · The package installer will put the JDK into this ...