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
🌐
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 the Java runtime can be done in a few simple step! ... Open Terminal and run the following command (It can also be found on the Brew website). Follow the instructions during the installation to add brew to your path, if you wish to.
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.
Discussions

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 runtime engine (JRE) on iMac M1 - Apple Community
Last time I tried to install JRE on my M1 iMac, it dont works. Is the problem always present? If not, what can I do to install it ? ... https://www.cloudynights.com/topic/584654-updating-celestron-firmware-with-macos/page-4#entry11117299 More on discussions.apple.com
🌐 discussions.apple.com
January 6, 2024
M1 Macbook, Big Sur, Base - No Java Installation Found
Hello! If you're asking for help with LibreOffice, please make sure your post includes lots of information that could be relevant, such as: Full LibreOffice information copied from the Help - About dialog (it has a copy button in 7.0) Format of the document(s) you're using (eg .odt, .xlsx) A link to the document itself, or part of it, if you can share it Anything else that may be relevant You can edit your post to add that information, or put it in a comment. That makes it much easier for people to help you :-) I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/libreoffice
3
2
October 8, 2021
Putting Java on Macbook Pro (M1)
No clue what you specifically mean by “insidious resource hog”, but Java is benign until you run a Java app, and even then it depends on what that app does. I have a long-running Java process on my Intel MBP that consumes around 180MB of RAM and about 20MB of disk space (ignoring the disk space used by the JVM itself - another ~325MB for v17). That’s in the same ballpark as, say, Pages (180MB of RAM, 415MB of disk), and a lot less than Google Chrome (many GB of RAM, 1GB of disk). More on reddit.com
🌐 r/MacOS
1
3
January 5, 2022
🌐
Oracle
java.com › en › download › help › mac_install.html
How do I install Java for my Mac?
6. The MacJRE Installer dialog appears, prompting the user to enter a password to continue. Enter Password and click Continue to proceed with installation. 7. This step will initiate install process. Once it is completed, a confirmation screen appears.
🌐
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.
🌐
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 - I'm using a MacBook Air M1 base model with 256GB internal SSD storage and processes which are not m1 optimised tends to write more on Swap which will reduce the SSD lifespan gradually. There might be other arguments on that but this my analysis ... I have found, Zulu has M1 Silicon Optimised OpenJDK which no longer requires Rosetta support. https://www.azul.com/downloads/?version=java-11-lts&os=macos&architecture=arm-64-bit&package=jdk More replies More replies More replies
🌐
Oracle
java.com › en › download › help › java_mac.html
Installing and using Oracle Java on macOS
Information about Oracle Java for Mac - Install, remove, revert Apple Java 6, configure, system requirements
🌐
OS X Daily
osxdaily.com › home › how to install java on mac with m3, m2, m1 apple silicon chip
How to Install Java on Mac with M3, M2, M1 Apple Silicon Chip - OS X Daily
June 3, 2024 - This particular walkthrough will ... the “MacOS” tab · For an Apple Silicon (M1, M2, M3, etc) Mac, choose the “ARM64 DMG Installer” download (Intel Mac users can use the X64 download, but we’re focusing on Apple ...
Find elsewhere
🌐
Oracle
java.com › en › download
Download Java
If you were asked to install Java to run a desktop application, it's most likely you need this version. Developers are encouraged to download the latest Java Development Kit from OTN downloads. Enterprise users with access to My Oracle Support or Oracle Software Delivery Cloud should download through those services. Download Java for macOS ARM64 By downloading Java you acknowledge that you have read and accepted the terms of the Oracle Technology Network License Agreement for Oracle Java SE.
🌐
Feliciano
feliciano.tech › blog › install-java8-on-macos
How to Install Java 8 on macOS | Feliciano.Tech
January 24, 2023 - Let's get straight to the “how” and stick around if you want to know the “why”. 1brew tap homebrew/cask-versions 2brew install --cask temurin8 Now here's some information on why this works and what it does.
🌐
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.
🌐
Mkyong
mkyong.com › home › java › how to install java jdk on macos
How to install Java JDK on macOS - Mkyong.com
January 19, 2021 - This article shows how to install Java JDK on macOS, Homebrew package manager, manual installation, and switch between different JDK versions.
🌐
Baeldung
baeldung.com › home › java › install java on macos
Install Java on macOS | Baeldung
April 14, 2024 - Installing Java via a DMG package involves a few manual steps: opening the .dmg package and following the on-screen instructions to complete the installation process. First, go to Oracle’s official site and download the dmg package. By default, the page lands on the Linux download tab, so we need to select the macOS tab and choose the correct dmg installer.
🌐
Centron
centron.de › startseite › java installation on macbook m1
Effortless Java Installation on MacBook M1
February 7, 2025 - To solve the problem, you need to use an OpenJDK version that is compatible with the ARM 64-bit architecture. We recommend Azul Zulu OpenJDK builds, which also provide builds for the ARM 64-bit architecture.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-install-java-on-macos
How to Install Java on MacOS: A Step-by-Step JDK Installation - GeeksforGeeks
January 11, 2025 - Here we will be discussing the first method where java can be downloaded from Oracle's official Website and can be installed with the help of the following steps: Go to the Oracle official site to download Java 23 by clicking on the download option ...
🌐
Snyk
snyk.io › blog › install-java-on-macos
How to install Java on macOS | Snyk
April 17, 2024 - Before installing Java on your macOS, it is essential to perform some pre-installation checks. These steps are crucial to avoid any conflicts with existing installations, ensure the system's compatibility, and, most importantly, confirm the need for the installation.
🌐
Class Central
classcentral.com › subjects › programming › programming languages › java
Free Video: How to Install Java on MAC M2, M1, and MacBook Pro from Mukesh otwani | Class Central
Learn step-by-step instructions for downloading and installing Java on MAC M2, M1, and MacBook Pro systems in this 13-minute tutorial video. Follow along with detailed guidance on editing or creating the .zshrc file, setting up environment variables including JAVA_HOME and PATH configurations, and properly sourcing the changes.
🌐
Azul Systems
azul.com › home › azul downloads
Java 8, 11, 17, 21, 25 Download for Linux, Windows and macOS
January 30, 2023 - Click here to download the Azul Zulu Builds of OpenJDK for Java 8, 11, 17, 21, 25 for Linux, Windows and macOS. Also download Azul Platform Prime.
🌐
Apache Maven
maven.apache.org › install.html
Installation – Maven
3 days ago - Apache Maven 3.9.16 (2bdd9fddda4b155ebf8000e807eb73fd829a51d5) Maven home: /opt/apache-maven-3.9.16 Java version: 1.8.0_45, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac" That’s it! Maven is now installed. Installation on macOS is supported by Homebrew, SDKMAN!
🌐
Apple Community
discussions.apple.com › thread › 255394383
Java runtime engine (JRE) on iMac M1 - Apple Community
January 6, 2024 - Last time I tried to install JRE on my M1 iMac, it dont works. Is the problem always present? If not, what can I do to install it ? ... https://www.cloudynights.com/topic/584654-updating-celestron-firmware-with-macos/page-4#entry11117299