sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
6.08k stars 629 forks source link

Question: sdkmanrc - Pin Java to minor or major-version #1154

Open tim-hilt opened 1 year ago

tim-hilt commented 1 year ago

Question

We have .sdkmanrcs in our project to ensure everyone's using the same java-version. However, we aren't particular to the exact-version. We just need a way to enforce (e.g.) Java 11.

The problem with setting the exact version is, that it might be outdated as soon as another developer joins the team. The existing team-members already have the java-version installed via sdkman, so sdk env works as expected. The new team-member can't install the now missing Java-version and we are forced to update the .sdkmanrc across all repositories, the new team-member is expected to use.

This is a chore I would like to avoid in the future.

Is there a way to use sdkman to achieve what I'm asking for? Is this maybe a non-idiomatic request that should be handled differently?

System info

Not relevant (will provide if seemingly relevant though)

FDelporte commented 1 year ago

+1

It would indeed be great if you would be able to install the latest version of a specific distribution of version.

For instance, with a command like this:

sdk install java {DISTRIBUTION} {VERSION}
sdk install java zulu 19
rafa-minimal commented 1 year ago

Would be perfect if you could simply put in your .sdkmanrc:

java=17

I guess full semver support is not necessary. Simply "get the latest version available starting with the prefix" would really do.