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 OverflowHomebrew
formulae.brew.sh › formula › jenv
Homebrew Formulae: jenv
brew install jenv · Manage your Java environment · https://github.com/jenv/jenv · License: MIT · Development: Pull requests · Formula JSON API: /api/formula/jenv.json · Formula code: jenv.rb on GitHub · Bottle (binary package) installation support provided.
GitHub
github.com › jenv › jenv
GitHub - jenv/jenv: Manage your Java environment · GitHub
On macOS, you can install jEnv using Homebrew: brew install jenv · Or if you use MacPorts on macOS: sudo port install jenv ·
Starred by 6.6K users
Forked by 398 users
Languages Shell 99.0% | Dockerfile 1.0%
Baeldung
baeldung.com › home › java › managing multiple jdk installations with jenv
Managing Multiple JDK Installations With jEnv | Baeldung
May 2, 2025 - $ jenv doctor [OK] No JAVA_HOME set [ERROR] Java binary in path is not in the jenv shims. [ERROR] Please check your path, or try using /path/to/java/home is not a valid path to java installation. PATH : /opt/homebrew/Cellar/jenv/0.5.4/libexec/libexec:/Users/jenv/.jenv/shims:/Users/user/.jenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin [OK] Jenv is correctly loaded
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 - jenv add /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home jenv add /Library/Java/JavaVirtualMachines/temurin-20.jdk/Contents/Home # ...
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.
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
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 - $ jenv versions * system (set by /Users/user/.jenv/version) 17 17.0 17.0.12 21 21.0 21.0.4 openjdk64-17.0.12 openjdk64-21.0.4 · $ java -version openjdk version "17.0.12" 2024-07-16 OpenJDK Runtime Environment Homebrew (build 17.0.12+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing)
DEV Community
dev.to › gabethere › installing-java-on-a-mac-using-homebrew-and-jevn-12m8
Brew Install Java: Installing Java on MacOS using Homebrew and JEnv - DEV Community
August 28, 2020 - $ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile $ echo 'eval "$(jenv init -)"' >> ~/.bash_profile ... Note: It's important that now you restart your bash terminal or run . ~/.zshrc to reload your .zshrc now that we have added a new command shortcut. Now let's go ahead and download a brew cask for the jdk version that we are after. Before we go and download the version that we need, ensure that you run the following command to add the brew repo to your machine (https://github.com/AdoptOpenJDK/homebrew-openjdk).
MungingData
mungingdata.com › java › jenv-multiple-versions-java
Running Multiple Versions of Java on MacOS with jenv - MungingData
Install jenv with brew install jenv. This is a Homebrew command.
Atevans
atevans.com › 2019 › 04 › 26 › jenv-and-java-versioning.html
atevans - Jenv and Java Versioning
April 26, 2019 - I had to manually add the “jenv init” and “enable-plugin” to my shell init scripts. Anyway, let’s try Java 11, as 11 is slightly less than 12 and 53 is slightly less than 56. $ brew tap homebrew/cask-versions $ brew cask install java11 $ jenv add /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home $ jenv local 11.0 $ jenv shell 11.0
Medium
medium.com › ayuth › set-up-multiple-java-dev-environments-for-macos-2025-edition-5aa4335f3d70
Set up Multiple Java Dev Environments for macOS — 2025+ Edition
November 3, 2025 - $ brew install jenv ==> Fetching downloads for: jenv ==> Downloading https://ghcr.io/v2/homebrew/core/jenv/manifests/0.5.9 Already downloaded: /Users/ayuth/Library/Caches/Homebrew/downloads/9027b15da7ef5210164c80246e675d8c3bccdf0dcc361f9c37663b81207284cd--jenv-0.5.9.bottle_manifest.json ==> Fetching jenv ==> Downloading https://ghcr.io/v2/homebrew/core/jenv/blobs/sha256:b454f9bfe4726a30422faed10c3fa103050a5dcb0fa39f366691bda9 Already downloaded: /Users/ayuth/Library/Caches/Homebrew/downloads/f37afca1709fc46f03b057d7f238c465a365e87f71f784c7e66c3765c9a96716--jenv--0.5.9.all.bottle.tar.gz ==> Pouring jenv--0.5.9.all.bottle.tar.gz ==> Caveats To activate jenv, add the following to your shell profile e.g.
Mtnr
mtnr.cloud › install-java-using-homebrew-and-jenv-on-macos
Install Java using Homebrew and jEnv on MacOS – mtnr
$ jenv add /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/
Mr N
bigsoft.co.uk › blog › 2025 › 11 › 07 › installing-all-the-javas-on-a-mac-and-switching-between-them
Installing all the Javas on a Mac and switching between them
November 7, 2025 - $ jenv global 11 $ echo $JAVA_HOME /Users/mrn/.jenv/versions/11 $ java -version openjdk version "11.0.29" 2025-10-21 OpenJDK Runtime Environment Homebrew (build 11.0.29+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.29+0, mixed mode)
GitHub
github.com › jenv › jenv › issues › 322
Java Homebrew installation instructions need to be updated · Issue #322 · jenv/jenv
March 17, 2021 - It would appear that brew cask install java, or even brew install --cask java, are no longer valid means of installing Java. Instead, it can be installed by running brew install java. I found this solution in a Stack Overflow thread. The...
Author jenv