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

findJavaRuntimes should search in more paths #596

Closed
rubensa opened this issue Apr 9, 2021 · 4 comments
Closed

findJavaRuntimes should search in more paths #596

rubensa opened this issue Apr 9, 2021 · 4 comments
Assignees
Milestone

Comments

@rubensa
Copy link

rubensa commented Apr 9, 2021

Suggestion

When looking for existing Java Runtimes, findJavaRuntime.ts should search in more paths than currently is doing.

At least it should look for the paths specified in java.configuration.runtimes settings variable (as those are already known runtimes).

It also would be great to look if known tools like SDKMan are installed and search their installation paths ($SDKMAN_DIR/candidates/java if SDKMAN_DIR env variable is defined or $HOME/.sdkman/candidates/java if not)

Use Cases

I'd like that the Installed JDKs tab from Configure Java Runtime view shows my installed JDKs.

Examples

Currently I have VSCode with Remote Development extension using a Docker container where I have installed multiple Java versions using SDKMan but only the one pointed by JAVA_HOME (that is set by SDKMan) is listed despite I have manually listed them all under java.configuration.runtimes.

Workaround

As a workaround I had to sym-link $SDKMAN_DIR/candidates/java to /usr/lib/jvm so my installed JDKs are listed.

@Eskibear Eskibear self-assigned this Apr 12, 2021
@testforstephen
Copy link
Contributor

Take a look at jEnv as well.

@achaphiv
Copy link

achaphiv commented Jun 25, 2021

The current behavior doesn't work when running via flatpak.

It would help to either:

  • Expose an environment variable to override /usr/lib/jvm
  • Also check /usr/lib/sdk/** (and its unique structure) by default

More context at: redhat-developer/vscode-java#510

@Eskibear
Copy link
Member

To systematically resolve this issue, I'm planning to make findJavaRuntime.ts a shared lib. This lib will possibly cover jdks installed by below tools:

  • sdkman
  • asdf
  • flatpak

let me know if there's other popular package manager/installer you want me to cover.

@Eskibear
Copy link
Member

Eskibear commented Dec 3, 2021

now use jdk-utils for more coverage.

@Eskibear Eskibear closed this as completed Dec 3, 2021
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

No branches or pull requests

4 participants