2

I have installed Java 8 & 19 using Homebrew Jenv on MacOS Monterey following their instruction. I wanted to use jenv for two different projects that I need to switch b/n the two versions.

Once I added the Home env't variable using

$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(jenv init -)"' >> ~/.bash_profile

then I went to add this command:

jenv add /Library/Java/JavaVirtualMachines/jdk-19.0.1.jdk/Contents/Home and

 jenv add /Library/Java/JavaVirtualMachines/jdk17011.jdk/Contents/Home

The result I got is: /Library/Java/JavaVirtualMachines/jdk-19.0.1.jdk/Contents/Home is not a valid path to java installation

and

/Users/docho/.jenv/versions/openjdk64-1.8.0.292: No such file or directory

What am I missing ?

EDIT: When I run java --version I see: openjdk version "1.8.0_292"

However when I run jenv versions I see this:

 * system (set by /Users/docho/.jenv/version)

JAVA_HOME also points to: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

But PATH variable has no Java related content:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/docho/.local/share/solana/install/active_release/bin:/Library/Apple/usr/bin:/Users/docho/.cargo/bin
WowBow
  • 7,137
  • 17
  • 65
  • 103

0 Answers0