On my Mac-pro OS-X Yosemite, I install java7 and java8 using Jenv.
$ brew cask install java8
$ brew cask install java7
Then execute the "jenv add" commands as followed for each java:
$ sudo jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/
oracle64-1.7.0.80 added
I can see both at /Users/xxxxx/.jenv/versions
$ ls -lrt
lrwxr-xr-x 1 root staff 64 Feb 1 13:42 oracle64-1.8.0.121 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
lrwxr-xr-x 1 root staff 63 Feb 1 13:49 oracle64-1.7.0.80 -> /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
But when I try to set java8 as global, it says that java8 is not installed.
$ jenv global oracle64-1.8.0.121
jenv: version `oracle64-1.8.0.121' not installed
Did I miss anything here? How can I fix this issue?
~/.jenv/version
where I replaced '13' with the most recent version that I added to jenv before, this was '13.0.1'. – JustCode