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
Answer from freedev on Stack Overflow
🌐
Oracle
oracle.com › java › technologies › javase › jdk17-archive-downloads.html
Java Archive Downloads - Java SE 17.0.12 and earlier
Go to the Oracle Java Archive page. This page includes archive downloads for JDK 17 updates 17.0.12 and earlier.
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.

Discussions

Java 17 for 10.8, 10.9, 10.10, and 10.11 & Java 11 for 10.6-10.11 (JDK) | MacRumors Forums
I'm completely replacing App -> ... my JDK 17 build. Seems to work fine. ... Hello everyone, I have also managed to build up-to-date upstream Java 11 (11.0.21) for 10.6 and newer: Download here: https://github.com/Jazzzny/jdk-macos-legacy/releases ... This is great! That is some awesome work. I'll keep updating any Java 8+ for Snow Leopard posts on StackOverflow etc. with your Java 11 Version ... Hi! I’m not sure if I downloaded the file properly and installed it to the ... More on forums.macrumors.com
🌐 forums.macrumors.com
July 20, 2023
how do i download Java 17
Upvote this comment if this is a good quality post that fits the purpose of r/Minecraft Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft Downvote this comment and report the post if it breaks the rules (Vote has already ended) More on reddit.com
🌐 r/Minecraft
3
4
October 11, 2025
HOW DO YOU DOWNLOAD AND USE JAVA 17?
If you download the installer that usually comes in a msi installer it should then Autodetect it. More on reddit.com
🌐 r/PrismLauncher
14
19
June 22, 2023
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
🌐
Oracle
oracle.com › java › technologies › downloads
Download the Latest Java LTS Free
Commercial license and support are available for a low cost with Java SE Universal Subscription. JDK 17.0.19 checksums and OL 9 GPG Keys for RPMs · Linux · macOS · Windows · Solaris · Documentation Download · Online Documentation · Installation Instructions ·
🌐
Homebrew
formulae.brew.sh › formula › openjdk@17
Homebrew Formulae: openjdk@17
brew install openjdk@17 · Development kit for the Java programming language · https://openjdk.org/ License: GPL-2.0-only WITH Classpath-exception-2.0 · Development: Pull requests · Formula JSON API: /api/formula/openjdk@17.json · Formula ...
🌐
Stony Brook University
www3.cs.stonybrook.edu › ~amione › CSE114_Course › materials › resources › InstallingJava17.pdf pdf
Installing Java 17 Downloading
To install the latest version of Java, go to the download site at Oracle.com. Scroll down to Java SE Development Kit 17.0.2 downloads. Click on the appropriate platform ... For mac, use the x76 DMG installer.
🌐
Snyk
snyk.io › blog › install-java-on-macos
How to install Java on macOS | Snyk
April 17, 2024 - java -version openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment Homebrew (build 17.0.9+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.9+0, mixed mode, sharing) Finally, verify that OpenJDK is installed correctly by checking the Java version again: ... If OpenJDK is installed correctly, this command should display the version of OpenJDK you installed. And there you have it! You've successfully installed OpenJDK on macOS.
Find elsewhere
🌐
MacRumors
forums.macrumors.com › macs › early intel macs
Java 17 for 10.8, 10.9, 10.10, and 10.11 & Java 11 for 10.6-10.11 (JDK) | MacRumors Forums
July 20, 2023 - I'm completely replacing App -> ... my JDK 17 build. Seems to work fine. ... Hello everyone, I have also managed to build up-to-date upstream Java 11 (11.0.21) for 10.6 and newer: Download here: https://github.com/Jazzzny/jdk-macos-legacy/releases ... This is great! That is some awesome work. I'll keep updating any Java 8+ for Snow Leopard posts on StackOverflow etc. with your Java 11 Version ... Hi! I’m not sure if I downloaded the file properly and installed it to the ...
🌐
Oracle
jdk.java.net › 17
JDK 17 Releases
JDK 17 has been superseded. Please visit jdk.java.net for the current version.
🌐
Baeldung
baeldung.com › home › java › install java on macos
Install Java on macOS | Baeldung
April 14, 2024 - Another way to install Java is via the command line. To accomplish this, we can use Homebrew, a popular package manager for macOS. Let’s see the steps for installing OpenJDK using Homebrew. Before we start, first, let’s make sure Homebrew is installed and up-to-date: ... % brew search openjdk ==> Formulae openjdk ✔ openjdk@11 openjdk@17 ✔ openjdk@8 openj9 openjph openvdb ==> Casks adoptopenjdk
Top answer
1 of 3
1

I tested this answer using a clean install of High Sierra 10.13.6. All updates from Apple were installed.

The downloads of the JDKs can be found at Java Downloads. I could not correctly view this site using Safari under High Sierra. Instead, I installed and used Firefox ESR (Extend Support Release). This link for Firefox download can be successfull viewed from Safari. The file I downloaded and installed was Firefox 115.16.1esr.dmg.

I tried JDK 23 by downloading and installing jdk-23_macos-x64_bin.dmg. This was not recognized by Java. Next, I tried JDK 21 by downloading and installing jdk-21_macos-x64_bin.dmg. This was recognized by Java.

Instructions for uninstalling a JDK can be found here. Personally, I just used the Finder to move the /Library/Java/JavaVirtualMachines/jdk-23.jdk folder to the Trash.

I tested by using the simple code given below. The code was stored in the file named Simple.java.

class Simple{  
    public static void main(String args[]){  
     System.out.println("Hello Java");  
    }  
}

Example of testing is given below.

dmas-Mac:Desktop dma$ javac Simple.java 
dmas-Mac:Desktop dma$ java Simple
Hello Java

BTW, I tested JDK 23 using macOS Monterey and did not encounter the problems that occurred with High Sierra.

2 of 3
0

I've successfully installed Java 21 from Microsoft on High Sierra.

$ java --version
openjdk 21.0.8 2025-07-15 LTS
OpenJDK Runtime Environment Microsoft-11933195 (build 21.0.8+9-LTS)
OpenJDK 64-Bit Server VM Microsoft-11933195 (build 21.0.8+9-LTS, mixed mode, sharing)

Java 25 has the some issue as mentioned above. It looks like the jdks have been build with a dependency to "chkstk_darwin" which ist not available in High Sierra.

🌐
Oracle
docs.oracle.com › en › java › javase › 17 › install › installation-jdk-macos.html
5 Installation of the JDK on macOS - Java
April 21, 2026 - For example, JDK 17.0.1 is installed in /Library/Java/JavaVirtualMachines/jdk-17.jdk. ... When starting a Java application through the command line, the system uses the default JDK. There can be multiple JDKs installed on the macOS system.
🌐
Se-education
se-education.org › guides › tutorials › javaInstallationMac.html
Java 17 Installation Guide for Mac Users
This guide explains how to install the (specifically, Java 17 JDK+FX Azul distribution) on macOS using SDKMAN.
🌐
OpenJDK
openjdk.org
OpenJDK
Learn about the key active Projects in the Community including Amber (high-productivity language features), Babylon (foreign programming models), Leyden (better startup and warmup), Loom (lightweight concurrency), Panama (foreign functions and foreign data), Valhalla (primitive types and ...
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-java-on-macos
How to Install Java on MacOS: A Step-by-Step JDK Installation - GeeksforGeeks
July 23, 2025 - Here we will be discussing the ... following steps: Go to the Oracle official site to download Java 23 by clicking on the download option as highlighted in the below media over where you need to download '.dmg' one and carry ...
🌐
Oracle
java.com › en › download › help › mac_install.html
How do I install Java for my Mac?
1. Download the jre-8u311-macosx-x64.dmg file. Review and agree to the terms of the license agreement before downloading the file. ... 4. Double-click on the .app icon to launch install Wizard. You might be prompted with message indicating app being downloaded from the Internet.
🌐
GitHub
github.com › orgs › Homebrew › discussions › 5173
Unable to install openjdk@17 latest version on M1 mac · Homebrew · Discussion #5173
HOMEBREW_NO_AUTO_UPDATE If set, do not automatically update before running some commands, e.g. brew install, brew upgrade and brew tap. Alternatively, run this less often by setting HOMEBREW_AUTO_UPDATE_SECS to a value higher than the default. Beta Was this translation helpful? Give feedback. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... Thanks a lot, after updating brew itself java has been updated correctly.
🌐
Besu-eth
docs.besu-eth.org › how to › install and update java
Install and update Java | Besu documentation
1 month ago - You might need to update your environment to make Java visible to Besu. Edit the .bashrc file in your home directory (or create it if needed) and add the following lines to the end of the file: ... You should see the JDK versions output. You can install OpenJDK on MacOS using Homebrew.
🌐
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.
🌐
Quora
quora.com › Why-can-I-not-download-Java-17-on-my-MacBook-Pro
Why can I not download Java 17 on my MacBook Pro? - Quora
Answer: Make sure you are downloading it from the source and meet the system requirements: https://www.oracle.com/java/technologies/javase/products-doc-jdk17certconfig.html It would appear that 17 will not run on High Sierra or earlier. Lion, Mountain Lion, Mavericks, Yosemite, El Capitan, and ...