In this post I'd like to make a quick overview of SDKMAN!, the tool I use to manage SDKs. Most of the content, if not all, is already present in its website. I just aim to make a straightforward introduction to it but all credit goes to its maintainer, Marco Vermeulen.
PATH
bash
and only requires curl
and unzip
to runInstalling SDKMAN! just requires opening a terminal and entering:
curl -s "https://get.sdkman.io" | bash
This will download and install SDKMAN! in $HOME/.sdkman
by default. The associated CLI command is sdk
.
There are mainly two kinds of commands available in sdk
:
install
or i
: install a candidate versionuninstall
or rm
: uninstall a candidate versionlist
or ls
: list available candidate versionsuse
or u
: use a candidate version in current shelldefault
or d
: set the default candidate version for every shellcurrent
c
: display current candidate versionupgrade
or ug
: upgrade outdated candidate versionversion
or v
: display the current version of sdkbroadcast
or b
: display the last broadcast messagehelp
or h
: show the sdk help messageoffline
: enable or disable offline modeselfupdate
: update the sdkflush
: flush sdk local stateThe most relevant and interesting are the ones to manage candidates.
With sdk list
we can list all the available candidates. These are the ones currently available:
For example, let's say we want to install the Scala SDK. First we can list the available Scala versions by running sdk list scala
:
==========================
Available Scala Versions
==========================
2.12.1
2.12.0
2.11.8
2.11.7
2.11.6
2.11.5
2.11.4
2.11.3
2.11.2
2.11.1
2.11.0
==========================
+ - local version
* - installed
> - currently in use
==========================
If we just want the latest version, all we need to do is run sdk install scala
, but if we want to install a specific version we can specify it as well by running sdk install scala 2.12.0
.
When having multiple versions installed, sdk current scala
will show the current version in use. Then, running sdk use scala 2.12.0
will switch the candidate version for the current terminal. On the other hand, running sdk default scala 2.12.0
will make the switch global and permanent.
That's pretty much all you need to start using SDKMAN!. I have nothing against installing the SDKs through the official channels but if you use many of them at the same time, keeping them up to date and managing multiple versions of each one can become a pain.
This tool surely makes it easier.
Would you like to leave a comment? Since this blog is hosted on GitHub Pages there's no straightforward way to do so.
Instead, you can add a comment in this GitHub issue. If you'd like to see it here, refresh this page after posting the comment.