Using sdkman to install and manage jdk versions

Using sdkman to install and manage jdk versions

  1. Use https://sdkman.io/
    1. Install it and follow the documentation
    2. Command to see the list of tools that can be installed with sdkman
      sdk list
      
    3. Command to see the list of available jdk versions
      sdk list java
      
      Sample output
      ================================================================================
      Available Java Versions for Linux 64bit
      ================================================================================
       Vendor        | Use | Version      | Dist    | Status     | Identifier
      --------------------------------------------------------------------------------
       Corretto      |     | 22           | amzn    |            | 22-amzn
                     |     | 21.0.2       | amzn    |            | 21.0.2-amzn
                     |     | 17.0.10      | amzn    |            | 17.0.10-amzn
                     |     | 11.0.22      | amzn    |            | 11.0.22-amzn
                     |     | 8.0.402      | amzn    |            | 8.0.402-amzn
       Dragonwell    |     | 17.0.10      | albba   |            | 17.0.10-albba
                     |     | 17.0.9       | albba   |            | 17.0.9-albba
                     |     | 11.0.22      | albba   |            | 11.0.22-albba
                     |     | 11.0.21      | albba   |            | 11.0.21-albba
      
      The Status column will say installed for the versions that are already installed in the computer. The Status column will say local only for the version that is the current default.
    4. Command to install a specific version of Java
      sdk install java 17.0.10-zulu
      
    5. Command to use a specific version in a shell
      sdk use java 17.0.10-zulu
      
    6. Command to see the current version
      sdk current
      
    7. Installing other tools
      sdk install maven 3.6.3
      sdk install gradle 6.2.2
      sdk install visualvm 2.0
      
    8. Where does sdkman unpack these installations?
      $HOME/.sdkman/candidates/java