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

Add Java path basename as an alias. #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Facsimiler
Copy link

@Facsimiler Facsimiler commented Jun 10, 2019

For a variety of reasons, I needed a means to identify a specific Java installation directory based upon the name of that directory, rather than its version information. This PR modifies the jenv add command to create an alias that is the basename of the path to the added Java installation.

The basename can also be a symbolic link to a specific Java installation, for added flexibiliy.

For example:

$ jenv add /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
adoptopenjdk-8-hotspot-amd64 added
openjdk64-1.8.0.212 added
1.8.0.212 added
1.8 added

The only issue I can foresee are clashes with the resulting additional aliases, but this is a latent issue with the jenv alias creation code.

This appears to address issues #68 (through use of a symbolic link) and #223 and possibly others, as I haven't had a chance to go through all of the outstanding issues as yet.

@jamieorc
Copy link

This was one of the first problems I encountered when I installed this today--the clash between the same AdopOpenJDK version with different JVMs.

@Facsimiler
Copy link
Author

@jamieorc Hi Jamie! As I pointed out, this is a latent issue with jenv's add command, not something that I introduced with this PR. You can manually tweak the alias's afterwards.

@jamieorc
Copy link

@Facsimiler Understood. I was just agreeing that I saw the same problem. Trying out both jenv and sdkman. jenv doesn't seem to be getting attention the past months, but I like it's simplicity and that it uses the existing Macos jdk location. sdkman is powerful and convenient for installing JDKs, but I don't like that it uses its own location for them.

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

Successfully merging this pull request may close these issues.

None yet

2 participants