I have the same problem. I solved this by edited the file /Users/[YourName]/.java-version myself. For example, I entered oracle64-1.8.0.121 as the first line in this file.

Answer from Duc Hiep Hoang on Stack Overflow
🌐
GitHub
github.com › jenv › jenv › issues › 100
jenv: version `oracle64-1.8.0-ea' is not installed · Issue #100 · jenv/jenv
June 11, 2015 - $ jgem install jbundle jenv: version `oracle64-1.8.0-ea' is not installed
Author   jenv
🌐
GitHub
github.com › jenv › jenv
GitHub - jenv/jenv: Manage your Java environment · GitHub
This will install the latest version of Java 8 to a special directory in macOS. Let's see which directory that is: $ ls -1 /Library/Java/JavaVirtualMachines openjdk-8.jdk openjdk.jdk · Observe the openjdk-8.jdk directory. Your exact version may vary. We cannot retrieve this using /usr/libexec/java_home, unfortunately. We'll add the Java home directory using jenv so that it shows up in our jenv versions command:
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 - This error message indicates that we have not yet set any local JDK version for this directory. Running the jenv version command in the absence of a local JDK version will display the global JDK version.
🌐
Atevans
atevans.com › 2019 › 04 › 26 › jenv-and-java-versioning.html
atevans - Jenv and Java Versioning
April 26, 2019 - $ brew cask install homebrew/cask-versions/adoptopenjdk8 $ jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home $ cd ~/Workspace/mapbox-java $ jenv local 1.8 $ jenv shell 1.8 # apparently 'jenv local' wasn't enough?? $ jenv version 1.8 (set by /Directory/.java-version) $ java -v Unrecognized option: -v Error: Could not create the Java Virtual Machine.
🌐
GitHub
github.com › jenv › jenv › issues › 107
Cannot add Java 8 · Issue #107 · jenv/jenv
July 27, 2015 - ➜ ~ jenv versions jenv: version `1.8' is not installed system 1.7 1.7.0.79 oracle64-1.7.0.79 ➜ ~ jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/ oracle64-Picked added Picked added There is already a Picked JDK managed by jenv Do you want to override (type y to confirm)?
Author   jenv
🌐
Bring
developer.bring.com › blog › configuring-jenv-the-right-way
Configuring jenv the right way – Bring Developer
July 27, 2018 - Without this the command following below will not work as expected. Check you jdk installation directories.. and then run the below commands as appropriate for you.. $ jenv add /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home · You can add multiple jdks if you want. Type jenv versions on terminal. You would see something similar to this.. system (set by /Users/sujithsreekumar/.jenv/version) - 1.8 - 1.8.0.92 - 10.0 - 10.0.1 - 9.0 - 9.0.1 - oracle64-1.8.0.92 - oracle64-10.0.1 - oracle64-9.0.1
🌐
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 - Run the below command to verify the installation. ... In my case, I am using ZSH shell for my terminal. So if we see the error “Jenv is not loaded in your zsh”, follow the suggested command to update the .zshrc config file and restart my ZSH session.
Find elsewhere
🌐
GitHub
github.com › jenv › jenv › issues › 284
Cannot add a version to jenv even though it has been removed · Issue #284 · jenv/jenv
March 24, 2020 - Even removing this version i.e. openjdk64-11.0.2 does not help. Jenv is still assuming, that openjdk64-11-0.2 is installed even though it has been removed from the directory /Library/Java/JavaVirtualMachines/: `user@macbook JavaVirtualmachines % ls -l total 0 drwxr-xr-x 3 root wheel 96 20 Mär 23:40 adoptopenjdk-8.jdk drwxr-xr-x 5 root wheel 160 28 Mär 2019 javafx-sdk-11.0.2 drwxr-xr-x 3 root wheel 96 21 Mär 00:08 jdk-11.0.2.jdk drwxr-xr-x@ 4 root wheel 128 20 Mär 23:26 jdk-14.jdk drwxr-xr-x 3 root wheel 96 10 Dez 2013 jdk1.7.0_45.jdk drwxr-xr-x 3 root wheel 96 5 Nov 2015 jdk1.8.0_45.jdk drwxrwxrwx 4 root wheel 128 28 Mär 2019 sapmachine-jdk-11.0.2.jdk user@macbook JavaVirtualmachines % jenv versions system 1.7 1.7.0.45 1.8 1.8.0.242 1.8.0.45
Author   jenv
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.

🌐
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 versions * system (set by /Users/rob/.jenv/version) 1.8 1.8.0.275 12 12.0 12.0.2 15 15.0 15.0.1 openjdk64-1.8.0.275 openjdk64-12.0.2 oracle64-15.0.1 · Update: with newer version of jenv, use jenv local · I like to set a given Java version on a per-directory basis using jenv local. For example to set Java 12 for OpenWhisk, I navigate to ~/Project/openwhisk and type: ... This will create a .java-version file in the directory with the specified version. Whenever you I navigate to this directory or a sub-directory of it, then jenv will ensure that Java 12 will be used.
🌐
GitHub
github.com › jenv › jenv › issues › 167
jenv add "ln No such file or directory" · Issue #167 · jenv/jenv
April 7, 2017 - xxxx-MacBook-Pro:Home reapor.yurnero$ java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) Then I tried jenv add jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home but it shows ln: /Users/reapor.yurnero/.jenv/versions/oracle64-1.8.0.121: No such file or directory So I'm confused which procedure am I wrong.
Author   jenv
🌐
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
🌐
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. Now any library that's looking for the JAVA_HOME environment to be set won't error out. Run jenv doctor to confirm your setup is good. You should get output like this: [OK] JAVA_HOME variable probably set by jenv PROMPT [OK] Java binaries in path are jenv shims [OK] Jenv is correctly loaded · Here's the command to install Java 11: brew cask install adoptopenjdk/openjdk/adoptopenjdk11.
🌐
Jenv
jenv.be
jEnv - Manage your Java environment
$ jenv versions system oracle64-1.6.0.39 * oracle64-1.7.0.11 (set by /Users/hikage/.jenv/version) ... The project is Open Source and open to external contributions. Do not hesitate to clone it and propose a pull request.
🌐
Stack Overflow
stackoverflow.com › questions › tagged › jenv
Newest 'jenv' Questions - Stack Overflow
Just bought a new MacBook Pro with ... jEnv I installed Zulu 8 ARM JDK When executing "jenv add" command, I keep ... ... I am tryin to use JEnv on windows 10. But I got the following error. C:\dev_tools\JEnv\src\jenv.ps1 is not digitally signed. You cannot run this script on the current system. I tried run Set-... ... When I run jenv versions, it shows below options 11.0 11.0.21 17.0 17.0.9 21.0 21.0.1 zulu64-11.0.21 ...
🌐
Stack Overflow
stackoverflow.com › questions › 76394732 › java-version-command-not-recognizing-jenv-installed-version-how-can-i-fix-thi
Java --version command not recognizing jenv installed version. How can I fix this? - Stack Overflow
java --version command is not working after setting the version using jenv. ➜ ~ java --version Usage: java [options] [args...] (to execute a class) or java [option...