Hi,
How to find what is installed with Sdkman?
There doesn't seem to be a sdk list installed commands, and just calling sdk list simply shows all potential SDKs to install.
Thanks.
Please refrain from using Github issues for usage questions. Use the Gitter user-issues chat instead.
@marc0der it's not a usage question :) .
Sorry for sounding harsh, that was not the intention. The website usage page clearly states that the command to use here is sdk current.
Thank you very much. Not sure how I missed that one :( .
Thanks, helped me as well. Intuitively I also went for sdk list --installed or something like that.
Probably a good thing to consider changing sdk list, to sdk available. 1 makes more sense, and 2 that frees you up for using sdk list to show the list of installed. sdk current isn't exactly clear on what it does in its name as sdk list would be for showing all installed. Better yet, get rid of sdk current and just add a sdk list --installed. Probably even better.
@btassone apologies for never replying on this but don't think I ever got notified about your comment.
I agree that renaming list to available would make a lot of sense. It would however be _very_ confusing for all our long-time users though.
Regarding the other suggestion of qualifying sdk list with a --installed flag, I don't think this is a good idea as it goes against the command syntax of sdkman. We don't use flags like this anywhere else. The syntax always (strictly) falls into the pattern:
sdk <command> [version] [qualifier]
If we introduce something better or more intuitive it should fall into the same pattern.
In other words, sdk list installed would fall into this pattern, but then what does sdk list do if we rename it to available?
My suggestion that we bring about such change in small steps: Leave sdk list to be what it currently is for the time being, then introduce the installed qualifier on top of the list command to replace current. wdyt?
I think the last suggestion sounds best. "sounds" meaning the way it reads or is spoken. so sdk list installed and sdk list available reads nice and looks intuitive. sdk list could stay the same for some time and then change or simply point to the other statements.
was this ever done? - confused me for a bit this AM before some googling lol
@tb582 no, still waiting for the pull requests to come in :laughing:
@lcxw the beauty of open source is that _you_ can contribute a solution.
sdk list could continue as an alias for sdk available. sdk installed could implement the new functionality. I don't see a need to insert list after sdk and before available|installed.
I've installed several javas, how can I list them all with their paths? The 'sdk current' shows only the current one.
The only way I've found is:
sdk list java | grep installed
Hope that helps
Unless I'm missing something, sdk current only shows the currently active JDK version.
It doesn't list all the installed versions.
As per @ibethencourt answer, this is the only way (AFAIK) for checking all currently installed versions, which I'd love to have in SdkMan itself!
If I'm missing something please correct me.
Have a nice day!
I don't think it's an issue rather than inprovment.
As @ibethencourt saying, _sdk list java | grep installed_ is such a good way to solve the issue.
This doesn't work if you want to see all candidates their installed versions.
So I resorted to this:
β tree -L 2 ~/.sdkman/candidates/
/home/aairey/.sdkman/candidates/
βββ gradle
βββ 6.4
βββ current -> /home/aairey/.sdkman/candidates/gradle/6.4
3 directories, 0 files
This works as long as you use the default local-path for your candidates.
added this into my .zshrc
sdkman() {
[[ "$1" == "installed" ]] && sdk list $2 | grep installed || sdk "$@"
}
now i can run sdkman installed java
works great
Stumbled here because I was searching for something similar. I have 4 jdk's installed for different purposes. so when I wanted to switch between, for example jdk 8 to jdk 11, I always forget the exact identifier, "11.0.7.hs-adpt" So I was hoping there was some command which just list just the installed java instead of entire list which require me to scroll up and search for the correct identifier.
This would also be useful in uninstalling redundent/unneeded versions. We can list the installed kotlin and with information in front of us we can type commands easily.
I am surprised this isn't readily available since the list of sdk and jdk has gotten really large. An ideal case would be something like _sdk switch java_, which would show an _alternatives_ like menu to switch java version.
@Abhinav1217: If you use zsh, oh-my-zsh has command line argument completion for sdkman.
Commands that only work with installed versions will only display / autocomplete installed versions.
I donβt know if sdkman argument completion exists for bash, or how well any such argument completion works.
I am on primarily bash, But I have omz installed I can switch to it temporarily. Currently I set sdkman to offline to limit the list to installed only.
Hi Guys from 2020. Is there a SDKMAN command that list all locally installed packages or it is better to back to the question in 2021 or 2022 ?
@barmalei Not yet. Best I usually work with is set sdkman to offline and then list Java, It shows only installed versions, making it easier to switch. I did create a script for sdkman to do it automatically, but I usually ends up typing whole set as I distro-hop quite frequently.
+1
I use shell autocompletion with sdk use and it works well for me to see what versions are installed. Review https://github.com/sdkman/sdkman-cli/issues/83 to see how to enable it for your favorite shell
Most helpful comment
Sorry for sounding harsh, that was not the intention. The website usage page clearly states that the command to use here is
sdk current.