Installing SDKMAN! on UNIX is a breeze. It effortlessly sets up on macOS, Linux and Windows (with WSL). Plus, it's compatible with both Bash and ZSH shells.
Just launch a new terminal and type in:
$ curl -s "https://get.sdkman.io" | bash
Follow the on-screen instructions to wrap up the installation. Afterward, open a new terminal or run the follwing in the same shell:
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
Lastly, run the following snippet to confirm the installation's success:
$ sdk version
You should see output containing the latest script and native versions:
SDKMAN! script: 5.18.2 native: 0.4.2
For Windows, there are two installation routes:
- WSL Approach: Install Windows Subsystem for Linux (WSL) before attempting SDKMAN installation. A basic toolset (bash, zip, unzip, curl) is necessary. Most times, it works out of the box.
- Git Bash Solution: If you use Git Bash for Windows, you'll need to supplement it with MinGW to have the required toolset for SDKMAN. There are some issues with this approach, but it works for the most part.
Remember, SDKMAN requires a bash environment to run. On Windows, it can't be natively installed; you need WSL or MSYS+MinGW. We no longer support Cygwin.
Feeling adventurous? We've got a beta channel. New CLI features hit this channel first for trial. You can join by installing it directly:
$ curl -s "https://beta.sdkman.io" | bash
To leave the beta channel, simply set
~/.sdkman/etc/config, then run:
$ sdk selfupdate force
Here is how you go about removing SDKMAN! from your system:
- Optionally backup and then remove the installation:
- Remove initialization snippet from your shell configs. Edit and remove the initialisation snippet from your
$ tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman $ rm -rf ~/.sdkman
.profilefiles. If you use ZSH, remove it from the
.zshrcfile. The snippet of code to be removed looks something like this:
Once removed, you have successfully uninstalled SDKMAN! from your machine.
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! [[ -s "/home/dudette/.sdkman/bin/sdkman-init.sh" ]] && source "/home/dudette/.sdkman/bin/sdkman-init.sh"
Install to a custom location
Lastly, if you want to install SDKMAN! in a custom location, like
make sure you have full access rights and that the folder doesn't exist. Export
SDKMAN_DIR before installing:
$ export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | bash
Install without modifying shell config
And for installs on CI where shell config modification isn't appropriate, add
as a parameter when downloading the installer:
$ curl -s "https://get.sdkman.io?rcupdate=false" | bash
That's all there is to it! Now let's dive into Usage.