|
| 1 | +--- |
| 2 | +title: Installation |
| 3 | +--- |
| 4 | + |
| 5 | +Installing SDKMAN! on UNIX is a breeze. It effortlessly sets up on macOS, Linux |
| 6 | +and Windows (with WSL). Plus, it's compatible with both Bash and ZSH shells. |
| 7 | + |
| 8 | +Just launch a new terminal and type in: |
| 9 | + |
| 10 | +```shell |
| 11 | +curl -s "https://get.sdkman.io" | bash |
| 12 | +``` |
| 13 | + |
| 14 | +Follow the on-screen instructions to wrap up the installation. Afterward, open a |
| 15 | +new terminal or run the following in the same shell: |
| 16 | + |
| 17 | +```shell |
| 18 | +source "$HOME/.sdkman/bin/sdkman-init.sh" |
| 19 | +``` |
| 20 | + |
| 21 | +Lastly, run the following snippet to confirm the installation's success: |
| 22 | + |
| 23 | +```shell |
| 24 | +sdk version |
| 25 | +``` |
| 26 | + |
| 27 | +You should see output containing the latest script and native versions: |
| 28 | + |
| 29 | +```shell |
| 30 | +SDKMAN! |
| 31 | +script: 5.18.2 |
| 32 | +native: 0.4.6 |
| 33 | +``` |
| 34 | + |
| 35 | +## Windows installation |
| 36 | + |
| 37 | +For Windows, there are two installation routes: |
| 38 | + |
| 39 | +1. **WSL Approach**: Install Windows Subsystem for Linux (WSL) before attempting |
| 40 | + SDKMAN installation. A basic toolset (bash, zip, unzip, curl) is necessary. |
| 41 | + Most times, it works out of the box. |
| 42 | +2. **Git Bash Solution**: If you use Git Bash for Windows, you'll need to |
| 43 | + supplement it with MinGW to have the required toolset for SDKMAN. There are |
| 44 | + some issues with this approach, but it works for the most part. |
| 45 | + |
| 46 | +:::note |
| 47 | + |
| 48 | +Remember, SDKMAN requires a bash environment to run. On Windows, it can't be |
| 49 | +natively installed; you need WSL or MSYS+MinGW. We no longer support Cygwin. |
| 50 | + |
| 51 | +::: |
| 52 | + |
| 53 | +## Beta channel |
| 54 | + |
| 55 | +To leave the beta channel, simply set `sdkman_beta_channel` to false in |
| 56 | +`~/.sdkman/etc/config`, then run: |
| 57 | + |
| 58 | +```shell |
| 59 | +sdk selfupdate force |
| 60 | +``` |
| 61 | + |
| 62 | +## Uninstallation |
| 63 | + |
| 64 | +Here is how you go about removing SDKMAN! from your system: |
| 65 | + |
| 66 | +1. Optionally backup and then remove the installation: |
| 67 | + |
| 68 | + ```shell |
| 69 | + tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman |
| 70 | + rm -rf ~/.sdkman |
| 71 | + ``` |
| 72 | + |
| 73 | +2. Remove initialization snippet from your shell configs. Edit and remove the |
| 74 | + initialisation snippet from your `.bashrc`, `.bash_profile` and/or `.profile` |
| 75 | + files. If you use ZSH, remove it from the `.zshrc` file. The snippet of code |
| 76 | + to be removed looks something like this: |
| 77 | + |
| 78 | + ```shell |
| 79 | + #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! |
| 80 | + [[ -s "/home/dudette/.sdkman/bin/sdkman-init.sh" ]] && source "/home/dudette/.sdkman/bin/sdkman-init.sh" |
| 81 | + ``` |
| 82 | + |
| 83 | + Once removed, you have successfully uninstalled SDKMAN! from your machine. |
| 84 | + |
| 85 | +## Install to a custom location |
| 86 | + |
| 87 | +Lastly, if you want to install SDKMAN! in a custom location, like |
| 88 | +`/usr/local/sdkman`, make sure you have full access rights and that the folder |
| 89 | +doesn't exist. Export `SDKMAN_DIR` before installing: |
| 90 | + |
| 91 | +```shell |
| 92 | +export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | bash |
| 93 | +``` |
| 94 | + |
| 95 | +## Install without modifying shell config |
| 96 | + |
| 97 | +And for installs on CI where shell config modification isn't appropriate, add |
| 98 | +`rcupdate=false` as a parameter when downloading the installer: |
| 99 | + |
| 100 | +```shell |
| 101 | +curl -s "https://get.sdkman.io?rcupdate=false" | bash |
| 102 | +``` |
| 103 | + |
| 104 | +That's all there is to it! Now let's dive into [Usage](/usage). |
0 commit comments