Try the "export" plugin:

jenv enable-plugin export

You can check the Export plugin section in Readme.md at the jEnv Github repo (https://github.com/gcuisinier/jenv)

Answer from kimbaudi on Stack Overflow
🌐
GitHub
github.com › jenv › jenv
GitHub - jenv/jenv: Manage your Java environment · GitHub
For example, on macOS, use brew to install the latest Java (OpenJDK 21, also follow the caveat steps to symlink into the system virtual machines) followed by the appropriate jenv add PATH_TO_JVM_HOME command to recognize it.
Starred by 6.6K users
Forked by 398 users
Languages   Shell 99.0% | Dockerfile 1.0%
Discussions

Jenv not setting JAVA_HOME
Did I miss something; i'm trying to reset my JAVA_HOME with jenv and have tried all the command and it seems it is updating the values but not the JAVA_HOME? Any reason this should be happening... More on github.com
🌐 github.com
89
February 27, 2014
JAVA_HOME not set on apple m1
jenv 0.5.4 I execute follow steps on my m1 MBA and intel MBP: 1. brew install jenv 2. echo eval "$(jenv init -)" >> /Users/xiquan/.zshrc 3. jenv add $(/usr/libexec/java_home) 4. jen... More on github.com
🌐 github.com
11
October 20, 2021
🌐
Jenv
jenv.be
jEnv - Manage your Java environment
$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc $ echo 'eval "$(jenv init -)"' >> ~/.zshrc · $ eval "$(jenv init -)" $ jenv enable-plugin export ... $ 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
🌐
Baeldung
baeldung.com › home › java › managing multiple jdk installations with jenv
Managing Multiple JDK Installations With jEnv | Baeldung
May 2, 2025 - jEnv is a command line tool that helps us manage multiple JDK installations. It basically sets JAVA_HOME inside our shell in a way that can be set globally, locally to the current working directory, or per shell.
🌐
GitHub
github.com › jenv › jenv › issues › 44
Jenv not setting JAVA_HOME · Issue #44 · jenv/jenv
February 27, 2014 - Ians-MacBook-Pro:~ ian$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home Ians-MacBook-Pro:~ ian$ jenv local oracle64-1.7.0.45 Ians-MacBook-Pro:~ ian$ jenv global oracle64-1.7.0.45 Ians-MacBook-Pro:~ ian$ jenv shell shell shell-options Ians-MacBook-Pro:~ ian$ jenv shell oracle64-1.7.0.45 Ians-MacBook-Pro:~ ian$ jenv version oracle64-1.7.0.45 (set by JENV_VERSION environment variable) Ians-MacBook-Pro:~ ian$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home Ians-MacBook-Pro:~ ian$ jenv versions system oracle64-1.6.0.65 * oracle64-1.7.0.45 (set by JENV_VERSION environment variable) oracle64-1.8.0-ea Ians-MacBook-Pro:~ ian$ echo $JENV_VERSION oracle64-1.7.0.45 Ians-MacBook-Pro:~ ian$ cat .java-version oracle64-1.7.0.45 Ians-MacBook-Pro:~ ian$ ```
Author   jenv
🌐
Spring Framework Guru
springframework.guru › home › using jenv for setting the java_home path
Using jEnv for Setting the JAVA_HOME Path - Spring Framework Guru
May 19, 2020 - $ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile $ echo 'eval "$(jenv init -)"' >> ~/.bash_profile · If your using Zsh just change .bash_profile above to .zshrc and everything should work. You may need to logout and log back in to load changes. Now we can use jEnv to add different versions of Java by using the following command:
🌐
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 - # Take note to run below command if you are running on Apple Silicon Mac # echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc # Append jEnv init config to .zshrc echo eval "$(jenv init -)" >> ~/.zshrc # Restart ZSH session source ~/.zshrc # Alternative way to restart exec $SHELL -l ... Also, in order for jEnv to automatically set our JAVA_HOME, run the following commands to enable export plugin
🌐
Bring
developer.bring.com › blog › configuring-jenv-the-right-way
Configuring jenv the right way – Bring Developer
July 27, 2018 - $ jenv add /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
Find elsewhere
🌐
Abanoub Hanna
abanoubhanna.com › posts › jenv
Jenv: Manage the "JAVA_HOME" environment variable | Abanoub Hanna
April 11, 2025 - jenv is a command-line tool to manage the “JAVA_HOME” environment variable. Add a Java version to jEnv: jenv add path/to/jdk_home Display the current JDK version used: jenv version Display all managed JDKs: jenv versions Set the global JDK ...
🌐
GitHub
github.com › jenv › jenv › issues › 339
JAVA_HOME not set on apple m1 · Issue #339 · jenv/jenv
October 20, 2021 - 1. brew install jenv 2. echo eval "$(jenv init -)" >> /Users/xiquan/.zshrc 3. jenv add $(/usr/libexec/java_home) 4. jenv global 1.8 5. <open new terminal tab> 6.
Author   jenv
🌐
Thejavaguy
thejavaguy.org › posts › 002-use-jenv-to-manage-jdks
Use jEnv to manage JDKs - TheJavaGuy Software & Blog
March 17, 2022 - Even when you set up global JDK with jEnv, some applications from the Java ecosystem will search for JAVA_HOME environment variable in your system to find out where the JDK is located. Also, if you want to create and use executable Java scripts as single-file source code in GNU/Linux or MacOS then you must set JAVA_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 - When developing Android or Java applications, managing multiple Java versions can be crucial, especially if different projects require different versions. jEnv simplifies this process by allowing you to switch between Java versions effortlessly and set JAVA_HOME per project or globally.
🌐
Adam Gamboa G
blog.adamgamboa.dev › using-jenv-to-switch-jkd-versions
Using jEnv to switch JDK versions
December 24, 2021 - jEnv is a command line tool to help you forget how to set the JAVA_HOME environment variablejenv.be
🌐
MungingData
mungingdata.com › java › jenv-multiple-versions-java
Running Multiple Versions of Java on MacOS with jenv - MungingData
Run echo $JAVA_HOME and verify that it returns something like /Users/powers/.jenv/versions/openjdk64-1.8.0.272.
🌐
Liangzhou
liangzhou.dev › home › manage multiple java versions on mac o s using brew and jenv
Manage multiple java versions on macOS using brew and jenv - TODO Learn More
➜ ~ jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home or with ~java_home~ command: ➜ ~ jenv add $(/usr/libexec/java_home -v 1.8) oracle64-1.8.0.152 added 1.8.0.152 added 1.8 added ➜ ~ jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home or with ~java_home~ command: ➜ ~ jenv add $(/usr/libexec/java_home -v 1.7) oracle64-1.7.0.80 added 1.7.0.80 added 1.7 added
🌐
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/
🌐
OSTechNix
ostechnix.com › home › command line utilities › how to manage multiple java versions with jenv on linux
How To Manage Multiple Java Versions With jEnv On Linux - OSTechNix
June 27, 2020 - If you already have installed Java, just ignore this step. ... The above command will clone the contents of jEnv in a local directory named .jenv. ... Finally, update the changes we just made in ~/.bash_profile using command. ... If it doesn't work for any reason, just use ~/.bashrc instead of ~/.bash_profile. $ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc $ echo 'eval "$(jenv init -)"' >> ~/.bashrc $ source ~/.bashrc
🌐
My Developer Journal
sunitc.dev › 2021 › 04 › 23 › how-to-run-multiple-java-version-in-your-local-environment-using-jenv
How To Run multiple Java Version in your local environment using JENV – My Developer Journal
April 23, 2021 - You can check the same by running the command – java -version For us, the default version is 16.0.1 · One crude way to switch Java versions is to keep updating JAVA_HOME environment variable, and add JAVA_HOME/bin to the PATH environment variable.
🌐
Atevans
atevans.com › 2019 › 04 › 26 › jenv-and-java-versioning.html
atevans - Jenv and Java Versioning
April 26, 2019 - $ brew install jenv $ eval "$(jenv init - zsh)" $ jenv enable-plugin export $ jenv add $(/usr/libexec/java_home) $ jenv versions * system (set by /Users/andrewevans/.jenv/version) 12 openjdk64-12
🌐
javathinking
javathinking.com › blog › set-java-home-to-reflect-jenv-java-version
How to Set JAVA_HOME to Reflect jenv Java Version in MacOS Bash Profile — javathinking.com
JAVA_HOME is critical for many tools (e.g., Maven, Gradle, IDEs like IntelliJ) and scripts that rely on knowing the active Java installation path. In this guide, we’ll walk through installing jenv, adding Java versions to jenv, and configuring your macOS Bash profile to automatically sync JAVA_HOME with the currently active jenv Java version.