Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 2 java versions to jenv and I end up with a long list of verisons? #136

Open
iangregsondev opened this issue Mar 4, 2016 · 8 comments

Comments

@iangregsondev
Copy link

Hi,

I did the jenv add for

and now i get 8 different versions, I was expecting 2. What am I doing wrong. It seems for example doing the following line actually adds 2 entries.. i.e. this line

jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/

actually lists under the jenv versions 2 entries.

1.7
1.7.0.80

This is now my complete list.

➜ ~ jenv versions
system
1.7
1.7.0.80

  • 1.8 (set by /Users/ian/.jenv/version)
    1.8.0.45
    1.8.0.74
    oracle64-1.7.0.80
    oracle64-1.8.0.45
    oracle64-1.8.0.74
@Campano
Copy link

Campano commented Apr 14, 2016

Same here, I just installed java with cask, jenv with brew, and this is what I got:

$ jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/
oracle64-1.8.0.77 added
1.8.0.77 added
1.8 added

@gcuisinier
Copy link
Collaborator

That is the expected behavior.

That is allow to select any major version if needed ( 1.6) or à very specific one

@iangregsondev
Copy link
Author

Ah Ok, got it. Thanks. This does make sense now.

So just out of interest. If I install, for example 1.8.0_73 and _77...

so 1.8 would point to the last one added ? or the LATEST ?

@djangofan
Copy link

djangofan commented Apr 27, 2016

Mine shows this, and what is confusing about it is that these 2 links that start with "oracle64-" are generated and I don't know where those come from:

r0000@t0000 ~/.jenv/versions $ ls -a ~/.jenv/versions
./  ../  1.7@  1.7.0.80@  1.8.0.92@  oracle64-1.7.0.80@  oracle64-1.8.0.92@
r0000@t0000 ~/.jenv/versions $ jenv versions
  system
  1.7
* 1.7.0.80 (set by /Users/r0000/.jenv/version)
  1.8
  1.8.0.92
  oracle64-1.7.0.80
  oracle64-1.8.0.92

I never added those to oracle items. Now, if these are auto-generated, it would be nice if the command would say so, for example, like this:

r0000@t0000 ~/.jenv/versions $ jenv versions
  system (auto-generated)
  1.7 (auto-generated)
* 1.7.0.80 (set by /Users/r0000/.jenv/version)
  1.8 (auto-generated)
  1.8.0.92
  oracle64-1.7.0.80 (auto-generated)
  oracle64-1.8.0.92 (auto-generated)

The way it is now, its a little confusing and the first thing I thought was WTF.

@leoj3n
Copy link

leoj3n commented Jul 30, 2016

Same confusion with

$ brew cask install java7
$ jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
oracle64-1.7.0.80 added
1.7.0.80 added
1.7 added

So, oracle is auto-generated? What does that mean?

@bunnyhero
Copy link

i find if i try to use the "oracle64-*" ones, i get an error like this:

Unable to locate an executable at "/Users/bunnyhero/.jenv/versions/oracle64-1.7.0.45/bin/java" (-1)

but 1.7, etc, work fine.

@ghost
Copy link

ghost commented Sep 5, 2017

@gcuisinier Hi, so what about this oracle-* prefix? What is the purpose of it?

@LIttleAncientForestKami
Copy link
Contributor

One additional note on why it's confusing as it currently is:

./jenv add ~/.sdkman/candidates/java/8u152-zulu/
There is already a openjdk64-1.8.0.152 JDK managed by jenv
Do you want to override (type y to confirm)? y
openjdk64-1.8.0.152 added
There is already a 1.8.0.152 JDK managed by jenv
Do you want to override (type y to confirm)? Y
1.8.0.152 added
There is already a 1.8 JDK managed by jenv
Do you want to override (type y to confirm)? y
1.8 added

Out of one op I have three. Also, first my thought was: oh, it repeated the question, so it didn't override it previously? Or is it that 'y' doesn't work? Let's try 'Y' then!

Of course, that may be just me. Still, while I like the idea (choose Oracle or Zulu, choose 7 or 8, don't bother with smallish numbers), I think it should be more like an aside.

$ jenv add someJavaVersionFromSomeProvider
full-version-string-with-X-provider-and-Y-major-version-number added
Provider X set to full-version-string...
Major version Y set to full-version-string...

Same with overriding. My 2 cents obviously. I'm open for why you want it your way, may well be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants