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

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
[deleted by user]
Go here Then choose java(JRE) for consumers Then after installing java open mmc settings and click java There should be a auto detect press that and select java 17 More on reddit.com
🌐 r/MultiMC
7
8
March 11, 2023
I need help with upgrading from java 8 to java 17

Just search environment variable on start menu u will find it

More on reddit.com
🌐 r/javahelp
6
0
September 30, 2023
How to I install the latest version of JDK?
In image 3 you have multiple paths still pointing to JDK 11... windows is picking the first java.exe it comes across (which is in the JDK11 folders) You need to remove the Eclipse Adoptium and Microsoft\jdk-11.0.12.7-hotspot environment variables Ensure the same thing hasn't happened in the user specific PATH variable - you only showed us the system PATH variable ALSO (important) remove the Common Files\Oracle\Java\javapath environment variable. Oracle does some crappy workaround to try and point you to the "latest" of their JDKs by installing shortcuts in that folder - get rid of it, you don't need those as it only adds to the confusion and causes issues similar to the above. Restart after this and try again - if it's still not working then post updated screenshots Basically you should ONLY be pointing to 1 folder with java.exe if you want "java -version" to run that specific version on the command line You can also technically run: C:\Program Files\Java\jdk-20\bin\java.exe -version and this will output the desired version number. But if you want to be able to run just "java -version" then you have to do the above steps. As others have noted Java isn't really "installed" - it's just about telling programs where the exe is. Most IDEs like IntelliJ will let you specify the path without relying on the environment variables or they may also come with a built-in Java version, it really depends on how you want things to be configured. More on reddit.com
🌐 r/javahelp
29
3
June 24, 2023
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.

🌐
Reddit
reddit.com › r/prismlauncher › how do you download and use java 17?
r/PrismLauncher on Reddit: HOW DO YOU DOWNLOAD AND USE JAVA 17?
June 22, 2023 -

I have been tryign to find out how to download and use java 17 for prism but its seems to be IMPOSSIBLE since ive been looking at guides for an hour now and they all seem to be downloading java 17 But when i try to download it with those guides the java 17 des not end up where my java 8s witch prism detects is. C:/Program Files (x86)/Common Files/Oracle/Java/javapath And i have no idea how do put java 17 i download into javapath since it does nto do it automatically.

🌐
Se-education
se-education.org › guides › tutorials › javaInstallationWindows.html
Java 17 Installation Guide for Windows Users
Oracle Java 17 on Windows. ... Go to the Oracle download site here. ... Choose JDK 17 → Windows. ... Go ahead and sign in if you are prompted by Oracle, or register an account if you haven't done so. Alternatively, you may also download the JDK 17 x64 installer from another provider that ...
Find elsewhere
🌐
Medium
ansarali-edugaon.medium.com › set-up-jdk17-in-windows-11-f6c9ace6f427
Set up jdk17 in Windows 11.. Hi everyone…. | by Ansar Ali | Medium
July 12, 2024 - Once the application is downloaded, double-click on the file, follow the instructions, and install the application. ... My JDK kit directory’s path is ‘C:\Program Files\Java\jdk-17’. You can also choose a different ...
🌐
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.
🌐
Oracle
java.com › en › download › manual.jsp
Download Java
If you were asked to install Java to run a desktop application, it's most likely you need this version.
🌐
Oracle
java.com › en
Java | Oracle
Oracle Java is the #1 programming language and development platform. It reduces costs, shortens development timeframes, drives innovation, and improves application services. Java continues to be the development platform of choice for enterprises and developers · For End Users on a Desktop ...
🌐
Oracle
jdk.java.net › 17
JDK 17 Releases
JDK 17 has been superseded. Please visit jdk.java.net for the current version.
🌐
DEV Community
dev.to › realnamehidden1_61 › how-to-install-java-jdk-17-on-windows-10-5b0d
How to Install Java JDK 17 on Windows 10 - DEV Community
June 17, 2023 - step 1 : go to below site Java 17 Link step 2 : double click on downloaded exe... Tagged with java, jdk, install.
🌐
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 ...
🌐
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.
🌐
Jenkins
jenkins.io › download
Download and deploy
Once a Jenkins package has been downloaded, proceed to the Installing Jenkins section of the User Handbook. You may also want to verify the package you downloaded. Learn more about verifying Jenkins downloads. ... Generic Java package (.war) SHA-256: 5d19905e6c0f23aff89ff007de5564b96e0a05c13f4d1a92d0fdcb69b033bb9a
🌐
Fiji
imagej.net › software › fiji › downloads
Fiji Downloads
Any other system with a Java 8 runtime, except plugins using native libraries (e.g. 3D Viewer) Caution: “Program Files” not recommended! If you are installing Fiji on Windows, we strongly recommend that you store your Fiji directory somewhere in your user space (e.g., C:\Users\[your name]\Fiji) rather than in C:\Program Files or other system-wide directory.
🌐
ZAP
zaproxy.org › download
ZAP – Download
As with all software we strongly ... is only installed and used on operating systems and JREs that are fully patched and actively maintained. Most of the files contain the default set of functionality, and you can add more functionality at any time via the ZAP Marketplace. The core package contains the minimal set of functionality you need to get you started. The Windows and Linux versions require Java 17 or higher ...
🌐
JavaFX
openjfx.io
JavaFX
JavaFX runtime is available as a platform-specific SDK, as a number of jmods, and as a set of artifacts in Maven Central.
🌐
Se-education
se-education.org › guides › tutorials › javaInstallationLinux.html
Java 17 Installation Guide for Linux Users
This guide explains how to install the (specifically, OpenJDK Java 17) on Linux using the command line. This guide was created using Ubuntu 22.04 but the steps for other Debian based Linux distros should be similar.
🌐
Adoptium
adoptium.net
Home | Adoptium
Eclipse Adoptium provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure.