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
🌐
SDKMAN!
sdkman.io › usage
Usage | SDKMAN! the Software Development Kit Manager
sdk install java 17-zulu /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
JDKs
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
SDKs
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
Docs
Installing SDKMAN! on UNIX is a breeze. It effortlessly sets up on macOS, Linux
Vendors
SDKMAN! is unique in that it empowers SDK Vendors to publish their candidate
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

how do you install arm jdks with sdkman?
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://i.imgur.com/EJ7tqek.png ) 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. More on reddit.com
🌐 r/javahelp
8
2
January 9, 2024
java - is it possible install jdk from local using sdkman - Unix & Linux Stack Exchange
Now I am using sdkman to install jdk from internet failed, because of the network access problem, I could not install jdk. Now I want to using sdkman instal sdk from local. I think the procedure wo... More on unix.stackexchange.com
🌐 unix.stackexchange.com
Installs 64 bit java on 32 bit VM
I am using a 32 bit (fdroid/jessie32) VirtualBox VM. Used sdkman to install java and got an error. On investigation the 64 bit jdk had been installed. vagrant@testing32:~$ uname -a Linux testing32 ... More on github.com
🌐 github.com
11
January 28, 2017
sdkman! How to manage pre-existing JDK? - Stack Overflow
I wanted to try Java 19 and have easy switching back to the Java 17 that I have already installed. So, I installed sdkman but it knows nothing of the previous Java. Found the "install local&qu... More on stackoverflow.com
🌐 stackoverflow.com
🌐
SDKMAN!
sdkman.io › jdks
JDK Distributions | SDKMAN! the Software Development Kit Manager
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
🌐
SDKMAN!
sdkman.io › installation
Installation | SDKMAN! the Software Development Kit Manager
And for installs on CI where shell config modification isn't appropriate, add rcupdate=false as a parameter when downloading the installer: ... For automated environments like CI/CD pipelines, SDKMAN!
🌐
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.
🌐
SDKMAN!
sdkman.io
Home | SDKMAN! the Software Development Kit Manager
Formerly known as GVM, the Groovy enVironment Manager, SDKMAN! draws inspiration from familiar tools like apt, pip, RVM, and rbenv and even Git. Think of it as your helpful toolkit friend, ready to streamline SDK management for you. 🛠️ · Get started now! Go on then, paste and run the following in a terminal: ... Simplifying life. No more hunting for downloads, extracting archives, or tinkering with HOME and PATH environment variables. Install Software Development Kits for the JVM such as Java, Scala, Kotlin and Groovy.
🌐
SDKMAN!
sdkman.io › jdks › open
OpenJDK (jdk.java.net) | SDKMAN! the Software Development Kit Manager
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
Find elsewhere
🌐
Apache Pulsar
pulsar.apache.org › setting up jdks using sdkman
Setting up JDKs using SDKMAN | Apache Pulsar
Building the Pulsar master branch requires JDK 21 or JDK 25 (the bytecode targets Java 17). There is no separate build tool to install: Pulsar uses a Gradle build (migrated from Maven via PIP-463), and the repository includes the Gradle Wrapper — use ./gradlew. On Windows, developing inside WSL2 is strongly recommended (see Setup and building), where the Linux instructions apply as-is. The instructions below cover installing and managing JDK versions with SDKMAN.
🌐
DEV Community
dev.to › teaganga › how-to-install-java-on-linux-and-use-sdkman-to-switch-between-versions-249l
How to install Java on Linux and use SdkMan to switch between versions - DEV Community
June 13, 2025 - First find where Java was installed: ... That might return, for example, /usr/lib/jvm/java-17-openjdk-amd64/. To set it system-wide, edit /etc/environment: ... (Alternative) Use SDKMAN! If you need to frequently switch Java versions, to test specific features, the best is to use SDKMAN!.
🌐
trungtmnguyen
trungtmnguyen.com › blog › intsall-java-using-sdkman
Install Java Using SDKMAN: The Ultimate Guide for Java Developers | trungtmnguyen
July 26, 2025 - # Install the latest LTS version (Java 21) sdk install java 21.0.1-open # Install Java 17 (Previous LTS) sdk install java 17.0.9-open # Install Java 11 (Another LTS version) sdk install java 11.0.21-open # Install Amazon Corretto 17 sdk install java 17.0.9-amzn · During installation, SDKMAN will ask if you want to set this version as the default.
🌐
SDKMAN!
sdkman.io › sdks
SDK Installation Candidates | SDKMAN! the Software Development Kit Manager
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
🌐
Medium
duncanlew.medium.com › streamline-your-java-development-workflow-with-sdkman-f53002b99ece
Streamline Your Java Development Workflow with SDKMAN | by Duncan Lew | Medium
September 11, 2023 - If you’d like to make a specific Java version the default, like version 17 of Temurin, you can run the following command: ... We’ve seen how to install and switch between Java versions. But how would you know which SDKs are supported? No worries! The complete list of SDKs supported by SDKMAN can be found here: https://sdkman.io/sdks.
🌐
Reddit
reddit.com › r/javahelp › how do you install arm jdks with sdkman?
r/javahelp on Reddit: how do you install arm jdks with sdkman?
January 9, 2024 -

when i install jdks with sdkman it installs x86_64. when i run `sdk list java` i'm not seeing any arm versions either. is there a setting or flag i need to add?

Top answer
1 of 2
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://i.imgur.com/EJ7tqek.png ) 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.
2 of 2
1
When I run 'sdk list java' the top line shows: Available Java Versions for macOS ARM 64bit Do you see something different, does it show x86 here for you? If so this might be best best addressed with a support ticket with the sdkman team?
🌐
GitHub
github.com › sdkman › sdkman-cli › issues › 533
Installs 64 bit java on 32 bit VM · Issue #533 · sdkman/sdkman-cli
January 28, 2017 - Installing: java 8u121 Done installing! Setting java 8u121 as default. vagrant@testing32:~$ java -bash: /home/vagrant/.sdkman/candidates/java/current/bin/java: cannot execute binary file: Exec format error vagrant@testing32:~$ which java /home/vagrant/.sdkman/candidates/java/current/bin/java vagrant@testing32:~$ file `which java` /home/vagrant/.sdkman/candidates/java/current/bin/java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.9, BuildID[sha1]=c90f19ee0af98c47ccaa7181853cfd14867bc931, not stripped vagrant@testing32:~$
Author   sdkman
🌐
DZone
dzone.com › articles › how-to-manage-your-jdks-with-sdkman
How to Manage Your JDKs With SDKMAN
April 13, 2022 - $ java --version openjdk 11.0.3 ... AdoptOpenJDK (build 11.0.3+7, mixed mode) From SDKMAN, choose the AdoptOpenJDK JDK which is now provided by Adoptium and is called Eclipse Temurin....
🌐
YouTube
youtube.com › watch
Best way to Install JAVA JDK (with SDKMAN) | How to Install JAVA - YouTube
This video shows you how to install Java very quickly with any version and switch between different versions of java with ease using SDKMAN.Link to SDKMAN we...
Published   May 22, 2019