sdkman / sdkman-cli

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

Introduce commands to clean up unwanted versions #688

Open jjYBdx4IL opened 5 years ago

jjYBdx4IL commented 5 years ago

We require a conversation to take place in the appropriate Gitter Room before raising a new Github Issue. Please note that issues will be closed immediately if prior discussion did not take place. We need to do this to help manage the quality and validity of Issues raised on this project.

Please tick one:

Please explain the Issue / Feature Request here:

It would be great to have a simple way to clean/flush out all unnecessary stuff, ie. an extension of sdk flush archives.

sdk clean all

would do: sdk flush archives plus sdk clean $SDK for every installed SDK, ie. removing unused and unpinned versions.

sdk (un)pin $SDK $version

would make a specific version of an SDK immune against "sdk clean all|$SDK". Currently active versions of an SDK would be immune.

marc0der commented 5 years ago

Introduce commands to clean up unwanted versions

rgoldberg commented 4 years ago

Is this a more detailed version of part 2 of #643? If so, should these 2 issues be merged?

jjYBdx4IL commented 4 years ago

Yes

StefanLobbenmeierObjego commented 4 months ago

One currently annoying thing about the manual process is that I add the jvm installed via sdkman to intellij, after cleaning them out I always end up with a few broken paths. I would like sdkman to also manage a symlink like ~/.sdkman/candidates/java/JAVA_21 should point to the latest installed jvm, e.g. ~/.sdkman/candidates/java/21.0.3-jbr and ideally this also manages the vendors, e.g. ~/.sdkman/candidates/java/jbr also points to the latest installed jbr, while .sdkman/candidates/java/nik might point to ~/.sdkman/candidates/java/23.1.3.r21-nik

This would make cleaning up unwanted versions much less fragile as long as you only use the symlinks and not the real paths.

For now I will resolve to just always using ~/.sdkman/candidates/java/current in intellij, which is good enough for most projects and use gradle toolchains to manage the other candidates.