🌐
GitHub
github.com › jenv › jenv
GitHub - jenv/jenv: Manage your Java environment · GitHub
This will create a .java-version file we can check into Git for our projects, and jenv will load it correctly when a shell is started from this directory. ... Yes! Observe that JAVA_HOME is set to a valid shim directory - this is a result of enabling the export plugin. If you executed this commands inside your $HOME directory, you can now delete .java-version: ... Where multiple versions are set, the highest priority setting as above takes effect. For example if the global version was 17 and the shell version was 11, 11 would be used.
Starred by 6.6K users
Forked by 398 users
Languages   Shell 99.0% | Dockerfile 1.0%
Discussions

Not recognizing java 11
Installing java means you have ... java version "11" 2018-09-25 Java(TM) SE Runtime Environment 18.9 (build 11+28) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode) $ jenv versions system * 1.8 (set by /Users/boringusername/.jenv/version) 1.8.0.181 ... More on github.com
🌐 github.com
6
September 26, 2018
java - Not able to change the JDK in Mac OS using Jenv - Stack Overflow
I am using Amazon corretto JDK and earlier had only 1.8 installed in my Mac OS, yesterday I installed Amazon corretto JDK 11 using the Mac OS package installer and after that it changed my default java version to 11. I followed highly rated medium blog on Jenv to manage multiple version on ... More on stackoverflow.com
🌐 stackoverflow.com
How to choose between multiple JDK's on MacOS?
I have used sdkman - you can use it to manage your sdks like java, Scala, groovy More on reddit.com
🌐 r/java
30
22
August 29, 2021
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
🌐
MungingData
mungingdata.com › java › jenv-multiple-versions-java
Running Multiple Versions of Java on MacOS with jenv - MungingData
Use the jenv local openjdk64-11.0.9 command to set a given project to use Java 11 by default. This will add a .java-version file in the root project folder.
🌐
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
🌐
Baeldung
baeldung.com › home › java › managing multiple jdk installations with jenv
Managing Multiple JDK Installations With jEnv | Baeldung
May 2, 2025 - To demonstrate using multiple JDKs, let’s install one more JDK version – 11 and configure it with jEnv: $ jenv add /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home/ openjdk64-11.0.15 added 11.0.15 added 11.0 added 11 added
🌐
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 - If jEnv is correctly loaded but no Java version is set, follow the steps above to add Java environments. If you need to manage multiple Java versions (e.g., for Android development with Java 8 and a server using Java 11), install and add them to jEnv, then switch versions as needed using the commands from the previous section.
🌐
Adam Gamboa G
blog.adamgamboa.dev › using-jenv-to-switch-jkd-versions
Using jEnv to switch JDK versions
December 24, 2021 - $ 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
Find elsewhere
🌐
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 by running command – jenv versions · We have already installed 3 versions of JDK. We will just add their installation paths to the JENV. We can do so, by running jenv add <jdk-path> command. As you can see, we first added JDK ...
🌐
The AEM Maven
theaemmaven.com › post › switching-java-sdk-with-jenv
Switching Java SDK with jEnv - The AEM Maven
June 27, 2022 - Now you need to add each JDK that was listed out by /usr/libexec/java_home -V. For example ... If you are using Homebrew it is simple. The Homebrew formula has a dependency on an OpenJDK. Since we are providing our own, let us going to ignore it. ... Now that you have installed the JDKs, Maven and jEnv, you are ready to start changing the Java version.
🌐
Atevans
atevans.com › 2019 › 04 › 26 › jenv-and-java-versioning.html
atevans - Jenv and Java Versioning
April 26, 2019 - $ 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
🌐
Reflectoring
reflectoring.io › manage-jdks-with-jenv
Managing Multiple JDK Installations With jEnv
October 18, 2022 - Let’s say we’ve downloaded JDK 15 and extracted it into the folder ~/software/java/jdk-15+36. ... 11 11.0 11.0.8 13 13.0 13.0.2 14 14.0 14.0.2 15 openjdk64-11.0.8 openjdk64-13.0.2 openjdk64-14.0.2 openjdk64-15 · The JDK 15 has been added under the names 15 and openjdk64-15. jEnv supports the notion of a global JDK and multiple local JDKs.
🌐
DEV Community
dev.to › nkengasong_atem › manage-multiple-java-versions-on-linux-nfc
Manage multiple Java versions on Linux - DEV Community
June 11, 2020 - $ jenv add /usr/lib/jvm/java-1.8.0-openjdk-amd64 $ jenv add /usr/lib/jvm/java-11-openjdk-amd64
🌐
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 › 215
Not recognizing java 11 · Issue #215 · jenv/jenv
September 26, 2018 - Installing java means you have AGREED to the license at https://www.oracle.com/technetwork/java/javase/terms/license/javase-license.html $ /usr/libexec/java_home --exec java -version java version "11" 2018-09-25 Java(TM) SE Runtime Environment 18.9 (build 11+28) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode) $ jenv versions system * 1.8 (set by /Users/boringusername/.jenv/version) 1.8.0.181 oracle64-1.8.0.181
Author   jenv
🌐
Faun
faun.pub › mastering-multiple-java-versions-with-jenv-73e40c7bc625
Mastering Multiple Java Versions with jEnv | by Niluka Sripali Monnankulama | FAUN.dev() 🐾
March 15, 2025 - ... Here I will share steps to ... for Demo purposes as per your requirement and you can get any type and preferred version as well. Use jEnv to manage multiple Java versions....
🌐
Between Two Parens
betweentwoparens.com › blog › jenv
Manage your Java JDKs - Between Two Parens
January 1, 2020 - jenv add /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home ... and when we check versions available now by running jenv versions we have both 11 and 13 available to us:
🌐
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/
🌐
DEV Community
dev.to › sandrogiacom › multiple-jdks-no-problem-1knc
Multiple JDKs? No problem! - DEV Community
July 4, 2019 - $ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc $ echo 'eval "$(jenv init -)"' >> ~/.bashrc ... Assuming you need to keep Java 8 as default for legacy applications and use Java 11 in certain projects or directories.
Top answer
1 of 4
41

The problem that you are seeing is because jenv is not setup properly for your terminal. Depending on your terminal, you should look at your .bash_profile or .zshrc and ensure that the following lines exist:

Copyexport PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"

You can test to see if jenv has been initialized properly in your terminal by running which java. If jenv is initialized properly you will see something like:

Copy/Users/your-username/.jenv/shims/java

If you don't see this, double check .bash_profile or .zshrc as described above. I also recommend that you place these at the end of the file so that you can be sure that jenv gets added onto the start of your PATH.

The magic behind jenv is jenv init. When you open your terminal this runs and updates your PATH to look at ~/.jenv/shims which contains a shim (shell script) which resolves your desired version of Java when you run java or other JRE/JDK commands.

2 of 4
4

Behind the scenes jenv uses the /Library/Java/JavaVirtualMachines directory.

Then you could also type /usr/libexec/java_home -V to show all the available JDKs and analyse your issue:

CopyMatching Java Virtual Machines (4): 
11.0.2_2-OracleJDK, x86_64: "Java SE 11.0.2" /Library/Java/JavaVirtualMachines/OracleJDK-jdk-11.0.2.jdk/Contents/Home 
11.0.2_1-OpenJDK, x86_64: "OpenJDK 11.0.2" /Library/Java/JavaVirtualMachines/OpenJDK-jdk-11.0.2.jdk/Contents/Home 
1.8.0_11, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home 
1.7.0_45, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home 

/Library/Java/JavaVirtualMachines/OracleJDK-jdk-11.0.2.jdk/Contents/Home

In this exemple export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) set the JDK 1.8 version.

Thus, you even could define the following aliases:

Copyjava11_OpenJDK_export='export JAVA_HOME=$(/usr/libexec/java_home -v 11.0.2_1-OpenJDK)'
java11_OracleJDK_export='export JAVA_HOME=$(/usr/libexec/java_home -v 11.0.2_2-OracleJDK)'
java7_export='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'
java8_export='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'

NB: The version to use after java_home -v is defined in each JDK installation in the Contents/Info.plist file section JVMVersion.

I changed it, to easily switch between the OpenJDK and the Oracle JDK:

Copy$ tail -5 /Library/Java/JavaVirtualMachines/OpenJDK-jdk-11.0.2.jdk/Contents/Info.plist | head -2
<key>JVMVersion</key>
<string>11.0.2_1-OpenJDK</string>

$ tail -5 /Library/Java/JavaVirtualMachines/OracleJDK-jdk-11.0.2.jdk/Contents/Info.plist | head -2
<key>JVMVersion</key>
<string>11.0.2_2-OracleJDK</string>

So, in your case as you have two 1.8 versions (1.8 and 1.8.0.252). It is more than likely that you should update their Contents/Info.plist file section JVMVersion.