- Download and install git bash (https://git-scm.com/downloads/win)
Open Git Bash and run the following command to install and initialize SDKMAN:
Code Block curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
If you want to install SDKMAN in a custom location (e.g.,
/usr/local/sdkman
), use below command instead:Code Block export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | bash
source "/usr/local/sdkman/bin/sdkman-init.sh"
Verify the installation by running below command
Code Block sdk version
If you encounter an error about a missing zip utility, ensure it is installed on your system before proceeding.
- To install the zip utility, follow these steps:
- Visit the GnuWin32 zip package and download the file.
- Add the path to the bin folder (where the zip executable is located) to your system’s environment variables as shown in the below image.
- After that, restart Git Bash and repeat steps 1 and 3 from the SDKMAN installation process.
- Once SDKMAN is set up, you can use the following commands:
To list available JDKs:
Code Block sdk list java
To install a specific version of java
Code Block sdk install java <version>
To view installed versions of java
Code Block sdk list java
To check current active version of java
Code Block sdk current java
To use a specific version of java
Code Block sdk use java <version>
- To explore more SDKMAN commands, you can visit the official SDKMAN usage page.