Found that you need to register the java-17 dist in jenv using command:

Copyjenv add /usr/local/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home 

The path to /usr/local/opt/openjdk@17/libexec/openjdk.jdk you may take from your brew installation logs (found on the line sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk ...) and just add /Contents/Home

Now, it works

Copy> jenv local 17.0
> java -version                                                                                                                                     
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Homebrew (build 17.0.1+1)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.1+1, mixed mode, sharing)
Answer from lazylead on Stack Overflow
🌐
GitHub
github.com › jenv › jenv
GitHub - jenv/jenv: Manage your Java environment · GitHub
Use your platform appropriate package manager to install java. On macOS, brew is recommended. This document will show you how to install jenv, review its most common commands, show example workflows and identify known issues.
Starred by 6.6K users
Forked by 398 users
Languages   Shell 99.0% | Dockerfile 1.0%
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
MacOS - jenv local, without a ".java-version" file ?
I have the same situation and I use https://github.com/jdx/mise - multiple languages and multiple versions. Best of all, mise can understand the language-specific tool configuration file (as opposed to introducing yet another config file that the whole team needs to be watchful of when upgrading versions) More on reddit.com
🌐 r/commandline
7
3
August 14, 2024
Modern Java Practices

Java 15 is the current LTS ("long-term support") version

No it is not. Java 15 is only updated/patched until next release, which means for 6 months. LTS is something a company chooses to support for a long period of time. Oracle supports Java 8, Java 11, Java 17 (next LTS). Same for Redhat. I think Azure support Java 14 as LTS as well.

In general, you will find that AdoptOpenJDK is a go-to choice for obtaining the JDK.

You should go to official OpenJDK site to get your JDK.

Lombok

Section on Lombok. I would add a big warning or note. If you're promoting newest Java versions, I guess you know, that records have landed and in Java 16 they will be a standard feature. Combine it with upcoming withers and you can write:

record Point(int x, int y) {}
Point p;
Point pp = p with { x = 3; }

Lombok has a lot of problems, funnily enough, it broke IntelliJ recently and they had to do an emergency patching.

P.s. I can make a pull request for these suggested changes.

More on reddit.com
🌐 r/programming
84
58
October 8, 2020
How do I switch between Java versions?
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
13
11
March 20, 2023
🌐
javaspring
javaspring.net › blog › jenv-install-java-17
Mastering Java 17 Installation with jEnv — javaspring.net
In the ever-evolving world of Java ... between different Java versions on your system. In this blog post, we will delve into the details of using jEnv to install Java 17, exploring its fundamental concepts, usage methods, common practices, and best practices....
🌐
Jenv
jenv.be
jEnv - Manage your Java environment
$ jenv add /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home oracle64-1.6.0.39 added $ jenv add /Library/Java/JavaVirtualMachines/jdk17011.jdk/Contents/Home oracle64-1.7.0.11 added
🌐
Thejavaguy
thejavaguy.org › posts › 002-use-jenv-to-manage-jdks
Use jEnv to manage JDKs - TheJavaGuy Software & Blog
March 17, 2022 - # ivanmilosavljevic @ TJG in ~ [13:59:08] $ jenv global 17 # ivanmilosavljevic @ TJG in ~ [13:59:11] $ java -version openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-39) OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)
🌐
Medium
medium.com › javarevisited › manage-java-versions-with-jenv-6b8228552661
Manage Java Versions with jEnv. Master your Java Environment | by Jayson GCS | Javarevisited | Medium
September 11, 2023 - jenv add /opt/homebrew/Cellar/openjdk@17/17.0.8.1/libexec/openjdk.jdk/Contents/Home/ ... Verify that all the intended versions are correctly added to jEnv. ... Finally, we have a convenient setup to switch between Java versions seamlessly.
🌐
Medium
ymkfelix.medium.com › how-to-set-up-multiple-java-versions-on-a-macbook-8bae41345f72
How to set up multiple Java versions on a MacBook? | by Ye Min Ko | Medium
August 13, 2024 - sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk sudo ln -sfn /opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk · Now install jEnv.
Find elsewhere
🌐
Mehmet Baykar
mehmetbaykar.com › home › macos › how to set up jenv on macos
How to Set Up jEnv on macOS | Mehmet Baykar
December 27, 2025 - Before you can add Java versions to jEnv, you need to ensure that the Java Development Kit (JDK) is properly linked to a location that jEnv can access. First, install the desired Java versions using Homebrew. For example, to install Java 11 and 17:
🌐
Rob Allen
akrabat.com › using-jenv-to-select-java-version-on-macos
Using jenv to select Java version on macOS – Rob Allen
December 2, 2020 - $ jenv add /Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home/ $ jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home/ $ jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/ The exact ...
🌐
DEV Community
dev.to › blaytenshi › installing-multiple-java-on-macos-managed-by-jenv-l6i
Installing (multiple) Java on MacOS managed by jEnv - DEV Community
October 7, 2024 - Add the versions in Java VM folder to jenv so it can manage them jenv add /Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home/ jenv add /Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home/
🌐
Will Warren
willwarren.com › 2023 › 11 › 28 › install-multiple-jdks-with-jenv-and-homebrew-on-macos
Install and Use Multiple JDKs with jenv and Homebrew on macOS | Will Warren
November 28, 2023 - brew tap homebrew/cask-versions brew search temurin # this will list all the versions you can install brew install --cask temurin17 temurin20 temurin21 # etc... ... jenv add /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home jenv add /Library/Java/JavaVirtualMachines/temurin-20...
🌐
Bekk Christmas
bekk.christmas › post › 2022 › 16 › java-versions-are-easier-with-jenv
Java versions are easier with jEnv | Bekk Christmas
November 7, 2024 - ... Then, add it to jEnv by executing ... way is to set the Java version you use the most as default. For example, with Java 17: jenv global 17 ....
🌐
Medium
medium.com › java-mvp › guide-setting-up-and-switching-between-java-11-and-17-on-macos-9caff4c96e2d
Guide: Setting Up and Switching between Java 11 and 17 on macOS | by datatec.studio | Java MVP | Medium
November 25, 2023 - ... This post describes how to ... two versions. Table of Content Step 1: Install OpenJDK 11 Step 2: Install OpenJDK 17 Step 3: jenv — Make Switching between Java 11 and 17 possible...
🌐
Readthedocs
metadatacenter.readthedocs.io › en › latest › install-developer › prereq-jenv
Jenv - CEDAR - Read the Docs
In order to manage the multiple ... command will be executed Register all the JDKs that you might have on your system into jenv: jenv add /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/ ......
🌐
Baeldung
baeldung.com › home › java › managing multiple jdk installations with jenv
Managing Multiple JDK Installations With jEnv | Baeldung
May 2, 2025 - The good thing about jEnv is that we don’t need to install the JDK via a package manager. We can simply download a JDK and put it into a folder somewhere. Firstly, to use the new JDK with jEnv, we need to tell jEnv where to locate it.
🌐
Medium
medium.com › @pranesh7 › java-version-management-with-jenv-cc79357180c9
Java version management with jenv | by Pranesh Satghare | Medium
December 2, 2025 - Install Jenv on your Mac or Linux with the help of following link https://www.jenv.be/ ... jenv add /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home jenv add /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home jenv add /Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home
🌐
Adam Gamboa G
blog.adamgamboa.dev › using-jenv-to-switch-jkd-versions
Using jEnv to switch JDK versions
December 24, 2021 - It might be very common to require ... or Java 17, or any other version, while you are working on different projects or applications. One way to switch Java’s version is setting the JAVA_HOME env-var to the installation directory of the desire version. To help with that work jEnv is a tool ...
🌐
GitHub
gist.github.com › leifericf › f61c60a9ab889ed752f969e9db2009a0
Installing Java on macOS and Adding It to jEnv · GitHub
system 1.8 1.8.0.392 21.0 21.0.1 temurin64-1.8.0.392 * temurin64-21.0.1 (set by /Users/<user>/.jenv/version) The star (*) indicates that we have successfully set temurin64-21.0.1 globally. We can set a local version of Java for the current working directory: ... This will create a file called .java-version which specifies the Java version to use for this directory. ... openjdk 21.0.1 2023-10-17 LTS OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode)
🌐
MungingData
mungingdata.com › java › jenv-multiple-versions-java
Running Multiple Versions of Java on MacOS with jenv - MungingData
Find the exact name of the version with jenv versions. Check to make sure the javac -version and java -version commands are working. Macs come with Java preinstalled. It's always good to avoid using system installed programming language versions (applies to Python and Ruby too).
🌐
javaspring
javaspring.net › blog › installing-java-17-on-mac
Installing Java 17 on Mac: A Comprehensive Guide — javaspring.net
First, install jenv using Homebrew: ... public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } Compile the Java program using the javac compiler: ... Regularly update your Java 17 installation ...