SDKMAN! is a tool for managing parallel versions of multiple software development kits on most Unix-based systems. It provides a convenient command line interface (CLI) and API for installing, switching, removing and listing candidates.
Open a new terminal and enter:
curl -s "https://get.sdkman.io" | bash
Follow the instructions on-screen to complete installation. Next, open a new terminal or enter:
source "$HOME/.sdkman/bin/sdkman-init.sh"
Lastly, run the following code snippet to ensure that installation succeeded:
sdk version
If all went well, the version should be displayed. Something like:
sdkman 5.0.0+51
Install the latest stable version of your SDK of choice (say, Java JDK) by running the following command:
sdk install java
You will see something like the following output:
Downloading: java 8u111
In progress...
######################################################################## 100.0%
Installing: java 8u111
Done installing!
Now you will be prompted if you want this version to be set as default.
Do you want java 8u111 to be set as default? (Y/n):
Answering yes (or hitting enter) will ensure that all subsequent shells opened will have this version of the SDK in use by default.
Setting java 8u111 as default.
- To install a specific version qualify the version you require:
sdk install scala 2.12.1
- To remove a version
sdk uninstall scala 2.11.6
Note that removing a local version will not remove the local installation.
- To list candidates
sdk list
More useful commands and usages can be found at SDKMAN Usage.