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
🌐
Oracle
java.com › en › download › help › java_mac.html
Installing and using Oracle Java on macOS
How do I enable Java on my Mac? When you install Oracle Java on your Mac (Lion and above), Java will be enabled by default. If you are running a Java application in the browser, you will need to also check that Java is enabled in your browser. For earlier versions of Java, check Apple support site.
🌐
Oracle
oracle.com › java › technologies › downloads
Download the Latest Java LTS Free
Download the Java including the latest version 17 LTS on the Java SE Platform. These downloads can be used for any purpose, at no cost, under the Java SE binary code license.
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.
🌐
Medium
medium.com › @dimitrios_ › brew-your-java-on-a-m1-a-quick-guide-c28d17f2d256
Brew your java on a M1: A Quick Guide | by Jim Kapsalis | Medium
September 30, 2024 - Installing Java on a Mac M1 with Brew is a breeze, and this quick guide will have you coding in no time. In my case, I just needed the runtime to sip on some already “brewed” Java code.
🌐
Oracle
java.com › en › download › help › mac_install.html
How do I install Java for my Mac?
The screen shots and instructions below are for Java 8 Update 311 (8u311). If you are installing another version, make sure you change the version number appropriately. Example: For Java 8 Update 311 (8u311) the file to download is jre-8u311-macosx-x64.dmg · To confirm installed Java version, ...
Find elsewhere
🌐
Mac Install Guide
mac.install.guide › java › apple-silicon
Java on Apple Silicon or Intel Macs · Mac Install Guide · 2026
Java on Apple Silicon M-series or Intel Macs. How to install the correct Java version for your chip, verify ARM64 architecture, and configure for differences.
🌐
Cyberduck
cyberduck.io
Cyberduck | Libre server and cloud storage browser for Mac and Windows with support for FTP, SFTP, WebDAV, Amazon S3, OpenStack Swift, Backblaze B2, Microsoft Azure & OneDrive, Google Drive and Dropbox
Notifications in system tray (Windows) and the Notification Center (Mac). ... Reads your proxy configuration from network settings. Encrypts passwords limiting access to your account. Come in. You can follow the daily development activity, have a look at the roadmap and grab the source code on GitHub. We contribute to other open source projects including OpenStack Swift Client Java Bindings, Rococoa Objective-C Wrapper and SSHJ.
🌐
Apple Community
discussions.apple.com › thread › 254161853
How can you get Java for Apple Silicon? - Apple Community
September 4, 2022 - Oracle does provide versions of version 11 (https://www.oracle.com/java/technologies/downloads/#java11-mac) and newer for Apple Silicon. If you require Java 8, you can fallback to AWS Corretto (https://aws.amazon.com/corretto/), which is also available for Apple Silicon.
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to install java on mac
How to Install Java on Mac | phoenixNAP KB
May 8, 2025 - Oracle JDK is available for download on Oracle's website. Follow the steps below to download and install it on Mac. ... If you have an M1 or M2 Mac, choose the Arm 64 installer.
🌐
OpenJDK
openjdk.org › install
OpenJDK: Download and install
Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk.java.net as .tar.gz or .zip archives.
🌐
JFLAP
jflap.org › jflaptmp
JFLAP SOFTWARE
... May 15, 2011 - JFLAP Version 7.0 (with SVG fixed and thinner JFLAP - We now provide one version with SVG and one with the SVG split out into a second .jar - read the changes file below) NOTE: JFLAP uses Java 1.6. Mac users note that their default Java may be Java 1.5.
🌐
Baeldung
baeldung.com › home › java › install java on macos
Install Java on macOS | Baeldung
April 14, 2024 - In this short tutorial, we’ll discuss ways of installing Java on macOS. For our example, we’ll install Oracle JDK via DMG package and OpenJDK via Homebrew package manager.
🌐
Apache NetBeans
netbeans.apache.org › front › main › index.html
Welcome to Apache NetBeans
Apache NetBeans can be installed on all operating systems that support Java, i.e, Windows, Linux, Mac OSX and BSD.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-install-java-on-mac
How to Install Java on Mac in 2026
February 20, 2026 - Java is the most widely used programming language for enterprise software, Android development, and university computer science courses. Apple doesn't include Java with macOS, so you need to install it yourself.
🌐
Adoptium
adoptium.net › temurin › releases
Latest Releases | Adoptium
Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem.
🌐
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.
🌐
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
Top answer
1 of 4
19

I also ran into this today.

After installing openjdk with brew install openjdk, I got this too:

java --version

The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

It seems there is already system-wide default java command/alias (I had no previous Java install), so let's show the details:

which java

/usr/bin/java

However reading the output of the brew install log one can see:

==> openjdk

For the system Java wrappers to find this JDK, symlink it with
  sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

so, if you do not have another existing Java system-wide installation just run (and type your mac user password):

sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Password:

Now it works:

java --version

openjdk 21.0.2 2024-01-16
OpenJDK Runtime Environment Homebrew (build 21.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.2, mixed mode, sharing)
2 of 4
1

Since you installed Java previously with homebrew, you can use the brew info command to see the details of your installation:

% brew info java

openjdk: stable 15.0.1 (bottled) [keg-only]
Development kit for the Java programming language
https://openjdk.java.net/
/usr/local/Cellar/openjdk/15.0.1 (614 files, 324.9MB)
  Poured from bottle on 2020-12-09 at 09:06:07
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openjdk.rb
License: Cannot Represent