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
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.

🌐
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.
Discussions

macos - How to install java 17 on Mac using brew and setting up java_home? - Stack Overflow
Install java 17 on Mac using brew and setting up java_home More on stackoverflow.com
🌐 stackoverflow.com
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 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
Folks with M1 Macbooks and Macs. Oracle's JDK17 now officially supports ARM.
Also handy for using them free 24 GB Oracle Cloud ARM VMs. :) 4 Arm-based Ampere A1 cores and 24 GB of memory usable as one VM or up to 4 VMs. https://www.oracle.com/ca-en/cloud/free/#always-free More on reddit.com
🌐 r/java
6
47
September 16, 2021
🌐
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.
🌐
CodeJava
codejava.net › java-se › install-oracle-jdk-17-on-macos
Download and Install Oracle JDK 17 on macOS
April 28, 2022 - Head over to the official download page of Oracle JDK 17. You will see the following page:Click the link next to Arm 64 DMG Installer if your Mac running on Apple’s CPU, else click the link next to x64 DMG Installer for Intel’s CPU.And you should verify SHA256 checksum of the downloaded ...
🌐
Java With Us
javawithus.com › home › faq › how to install java 17 on mac
How to Install Java 17 on Mac | Java With Us
April 21, 2026 - Install Java 17 on Mac via brew install openjdk@17, symlink it, and switch with java_home. Full steps for Apple Silicon and Intel.
🌐
YouTube
youtube.com › the breakdown
How To Download & Install Java 17 on Mac - YouTube
If you want to know how to download Java 17 on MacOS, this is the video for you. We go over every single step of downloading, installing, and setting up Java...
Published   February 10, 2022
Views   77K
🌐
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
🌐
javaspring
javaspring.net › blog › installing-java-17-on-mac
Installing Java 17 on Mac: A Comprehensive Guide — javaspring.net
Select the macOS version of the Java 17 JDK installer. Download the .dmg file. Double - click the downloaded .dmg file to mount it. Double - click the .pkg installer inside the mounted volume.
🌐
CodeJava
codejava.net › java-core › install-openjdk-17-on-macos
Download and Install OpenJDK 17 on macOS
Visit the official download page of OpenJDK 17 at https://jdk.java.net/17, and click on the download link for macOS/x64 if your computer running on Intel’s CPU, or choose macOS/AArch64 for Apple’s CPU:It’s strongly recommend to verify SHA256 checksum of the downloaded file against the ...
🌐
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.
🌐
Oracle
oracle.com › java › technologies › javase › jdk17-archive-downloads.html
Java Archive Downloads - Java SE 17.0.12 and earlier
The archive downloads for JDK 17 updates 17.0.13 and greater are offered under different license terms, and can be found here. The JDK is a development environment for building applications using the Java programming language. The JDK includes tools useful for developing and testing programs written in the Java programming language and running on ...
🌐
Java With Us
javawithus.com › home › faq › how to install java 17 on windows, mac and linux
How to Install Java 17 on Windows, Mac and Linux | Java With Us
April 21, 2026 - Install Java 17 LTS on any OS: winget or Temurin MSI on Windows, brew install openjdk@17 on Mac, apt install openjdk-17-jdk on Ubuntu.
🌐
javathinking
javathinking.com › blog › jdk-17-install-mac
Installing JDK 17 on macOS: A Comprehensive Guide — javathinking.com
Double-click the downloaded .dmg file to mount it. Open the installer and follow the on-screen instructions (agree to the license agreement, select the installation location—default is /Library/Java/JavaVirtualMachines/).
🌐
Tutorials24x7
java.tutorials24x7.com › blog › how-to-install-java-17-on-mac
How To Install Java 17 On Mac | Tutorials24x7
September 27, 2021 - Open the download link to select the available versions as shown in Fig 3. ... Click the Download Option as highlighted in Fig 3. Double click the DMG file downloaded in the previous step to start installing Oracle JDK 17 on Mac.
🌐
javaspring
javaspring.net › blog › java-17-download-mac
Java 17 Download and Installation on Mac: A Comprehensive Guide — javaspring.net
On the Adoptium homepage, select the Java version as 17. Choose the appropriate package for your Mac (usually the .dmg file for macOS). Click the download button. If you have Homebrew installed on your Mac, you can use the following command ...
🌐
Medium
medium.com › java-mvp › install-openjdk-17-on-macos-c0ddb3ac9f0e
Install OpenJDK 17 on MacOS. Oracle JDK 17 ist currently the latest… | by datatec.studio | Java MVP | Medium
January 17, 2023 - java -version # Ignore the output if it said "no matches found:" sudo rm -fr /Users/$(whoami)/Library/Java/JavaVirtualMachines/* # Ignore the output if it said "no matches found:" sudo rm -fr /Library/Java/JavaVirtualMachines/* /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew uninstall openjdk@11 brew install openjdk@17 sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk java -version · That’s all for today, if you find this post is helpful, please give a like or click on the “Follow” button on my medium blog, this will probably get the article suggested more and get more readers.
🌐
TheBreakdown.xyz
thebreakdown.xyz › home › how to download & install java on mac
How To Download & Install Java on Mac - TheBreakdown.xyz
February 8, 2022 - First things first, we need to download Java for macOS. You can get to the Java download page by clicking the Download Java button above. You can also click this link to get to the Java download page.
🌐
Medium
michaeldacanay.medium.com › how-to-install-java-on-mac-1952ba52e796
How to Install Java on Mac - Michael Dacanay - Medium
July 20, 2023 - Here’s the Java 17 LTS download, and I use the ARM64 DMG installer for my M1 chip MacBook.