Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

About SDKMAN:
SDKMAN! is a free, open-source tool that helps users manage multiple Software Development Kits (SDKs) on Unix-based systems. It provides a command-line interface for installing, removing, listing, and switching between SDK versions. SDKMAN! is especially useful for Java developers, as it helps keep them up-to-date with the latest features and prevents compatibility issues. It works on various Unix-based platforms, including macOS, Linux, and Windows Subsystem for Linux (WSL).

SDKMAN! can install SDKs for the JVM, such as Java, Scala, Kotlin, and Groovy. It also supports other tools, such as Ant, Gradle, Grails, Maven, SBT, Spark, Spring Boot, and Vert.x.

Steps to Install SDKMAN:

  1. Download and install git bash (https://git-scm.com/downloads/win)
  2. Open Git Bash and run the following command commands to install and initialize SDKMAN:

    Code Block
    curl -s "https://get.sdkman.io" | bash
    
    
    source "$HOME/.sdkman/bin/sdkman-init.sh"
  3. If you want to install SDKMAN in a custom location (e.g., /usr/local/sdkman), use below command commands instead:

    Code Block
    export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | bash
    
    
    source "/usr/local/sdkman/bin/sdkman-init.sh"
  4. Verify the installation by running below command

    Code Block
    sdk version
  5. If you encounter an error about a missing zip utility, ensure it is installed on your system before proceeding.


  6.  To install the zip utility, follow these steps:
    1. Visit the GnuWin32 zip package and download the file.
    2. 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.



  7. After that, restart Git Bash and repeat steps 1 and 3 from the SDKMAN installation process.
  8. Once SDKMAN is set up, you can use the following commands: 
    1. To list available JDKs: This will display a list of all available JDKs, including the version and availability status (installed or not). You can review the list to identify the required JDK version and then install it.

      Code Block
      sdk list java
    2. To install a specific version of java use the below command. 

      Code Block
      sdk install java <version>

      For example, to install JDK 11 from Microsoft.

      Code Block
      sdk install java 11.0.25-ms
    3. To view installed versions of java

      Code Block
      sdk list java
    4. To check current active version of java

      Code Block
      sdk current java
    5. To use a specific version of java 

      Code Block
      sdk use java <version>
  9. To explore more SDKMAN commands, you can visit the official SDKMAN usage page.