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

Support Scoop installed JDK discovery on Windows #29121

Open
GingerGeek opened this issue May 13, 2024 · 2 comments
Open

Support Scoop installed JDK discovery on Windows #29121

GingerGeek opened this issue May 13, 2024 · 2 comments
Labels
a:feature A new functionality in:toolchains Java Toolchains 👋 team-triage Issues that need to be triaged by a specific team

Comments

@GingerGeek
Copy link
Contributor

GingerGeek commented May 13, 2024

Expected Behavior

Gradle should detect JDKs installed by Scoop (GitHub).

Scoop is a popular (20k+ stars) installer on Windows for command-line, non MSI installers similar to SDKMAN!, asdf and jabba that are already installed.

Through the Java bucket scoop can manage the install of many different JVM versions and distributions

Current Behavior (optional)

Currently Gradle does not detect the installation location of JDKs installed with scoop, unless invoked or if JAVA_HOME points to one of the installs. Builds may fail if they can't detect correctly installed required JVM versions.

Context

Scoop installs apps in self-contained folders, generally under %USERPROFILE%/scoop/apps

Each combination of JVM version (8, 11, 17, etc) and distribution (Temurin, Corretto) has it's own folder e.g temurin21-jdk.

With each folder there is a symlink of current that links to the latest installed version of that JVM within the folder.

Also see ScoopInstaller/Java#504

@GingerGeek GingerGeek added a:feature A new functionality to-triage labels May 13, 2024
@ljacomet ljacomet added in:toolchains Java Toolchains 👋 team-triage Issues that need to be triaged by a specific team and removed to-triage labels May 16, 2024
@ljacomet
Copy link
Member

This issue needs a decision from the team responsible for that area. They have been informed. Response time may vary.


  • Should we add this support?
  • Or should Gradle instead offer an SPI allowing users to add their own detection providers? (this is not a request for the attached PR to be modified to do that)

Related:

@GingerGeek
Copy link
Contributor Author

Thanks,

I agree you could quite easily bloat Gradle with detection for every toolchain out there, especially as in order to "fully" support them it becomes quite complex. e.g. with scoop installation directories can be varied and to "fully" resolve the installation locations you would have to read system environment and config files with the same logic as scoop itself.

The other toolchains seem to be done on a "as-default" basis so they just check the default paths... which is the current implementation in the PR

The SPI may be a preferred method but the DX would be a challenge I feel. You wouldn't want to include logic like this in project files with this, but similarly the experience of modifying gradle user settings is not always friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:toolchains Java Toolchains 👋 team-triage Issues that need to be triaged by a specific team
Projects
None yet
Development

No branches or pull requests

2 participants