Install Multiple Versions of Java with SDKMAN!
1 min readMay 4, 2023
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:
curl -s "https://get.sdkman.io" | bash
This will add the following to your .bashrc
or .zshrc
:
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/home/chris/.sdkman"
[[ -s "/home/chris/.sdkman/bin/sdkman-init.sh" ]] && source "/home/chris/.sdkman/bin/sdkman-init.sh"
Now you can open a new terminal and run the following to confirm installation:
sdk version
Using SDKMAN
SDKMAN will allow you to install a lot of different programs.
List all options to install
sdk ls
Installing Java
sdk install java