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
JDK lookups should include sdkman installed JDKs #1476
Comments
|
@jeffmaury can you tell us exactly which JDK you have installed using sdkman? And if possible can you see if that installed JDK has a Edit: Oh, and to be sure, if you type |
|
@jeffmaury is your case you don't have that java 17 from sdkman in path and you expect jbang to go search on local disk for alternative sdk installs? If yes then I'm not convinced that will provide a consistent behavior as sdkman has no notion of ordering of its jdks. You can if you want tell jbang about specific version of jdk to use: "jbang jdk install 17 |
I was running JBang with Java11.
installed with sdkman. |
|
Yes. So by you having java 11 in path that is what jbang will use and if does not fit it will fetch one of the adoptium installs via foojay api. there is no (sane) way for us to pick a reliable java version from sdkman as it has no ordering nor priority and multiple product variations. |
|
Why don't you search in |
|
@jeffmaury here is what is in my sdkman: which version do you suggest we should we pick for Java 16+ ? |
I would check current first (but it's likely going to fail as it's probably the one used to run JBang) then retrieve the versions from other candidates, sort them according to semver and select the first compatibile |
|
@jeffmaury that is slow, and how to choose between using graal vs open vs temurin vs librca ... it just not worth applying this complexity on all jbang users. you can write a script that syncs sdkman installs into jbang if users want that. Happy to add that to jbang-catalog if you wanna contribute it? |
|
|
This was implemented by #1500 But for now it still only works when explicitly enabling the sdkman provider. I that perhaps something we should think about changing @maxandersen and make scoop and sdkman enabled by default? |
|
We still don't have a notion of installing from those so can make them default can we ? |
I don't think we need to be able to install, it would be enough to use those JDKs. Activating those providers means that any JDKs that are installed can be used. Only if a specific Java version is requested that isn't available on the system will JBang use the default (Adoption) provider to install. |
Is your feature request related to a problem? Please describe.
When a specific version of Java is required for a script, the JDK installed by sdkman should be looked
Describe the solution you'd like
I had Java 17.0.3 installed by sdkman and ran https://raw.githubusercontent.com/maxandersen/gh-jtriage/main/jtriage.java but jbang says Downloading JDK 16.
Not mentioning permission issues on Windows
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: