Install Multiple Versions of Java with SDKMAN

What is SDKMAN?

SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits. This is very useful for managing Java versions as well as Gradle, Maven etc..

Installation

Open up a terminal and enter:

This will add the following to your .bashrc or .zshrc:

Now you can open a new terminal and run the following to confirm installation:

Install to a custom location

You can install to a custom location with the following command:

Install without modifying shell config

If you don't want it to modify your .bashrc or .zshrc then set rcupdate=fale:

Using SDKMAN

SDKMAN will allow you to install a lot of different programs.

List all options to install

Installing Java

Install default version:

Find a specific version:

Install a specific version based on identifier from list:

Using a specific version:

Default a specific version:

To update sdkman:

NOTE All of the above commands will work for the other programs available such as:

  • gradle
  • maven
  • groovy
  • kotlin
  • spark
  • springboot

Getting help

Optional Configuration

In ~/.sdkman/etc/config

References

SDKMAN!


Tagged in java