How To Install SDKMAN on AlmaLinux 9
In this tutorial, we will show you how to install SDKMAN on AlmaLinux 9. SDKMAN, short for Software Development Kit Manager, is a versatile command-line tool that allows developers to easily install, manage, and switch between multiple versions of various SDKs. It provides a centralized platform for handling SDKs, eliminating the need for manual installation and configuration. With SDKMAN, you can effortlessly install, update, and remove SDKs, as well as set default versions for your projects. The tool supports a wide range of SDKs, including Java, Groovy, Scala, Kotlin, Maven, Gradle, and more, making it a valuable asset for any developer working with these technologies.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the SDKMAN on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux or RHEL-based.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 9.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
- You’ll need root or sudo privileges to install SDKMAN and make system-wide changes. Make sure you have the necessary permissions before starting the installation process.
Install SDKMAN on AlmaLinux 9
Step 1. Update Your System.
Before proceeding with the SDKMAN installation, it’s recommended to update your AlmaLinux 9 system to ensure you have the latest packages and security fixes. Open a terminal and run the following command:
sudo dnf clean all sudo dnf update
This command will fetch the latest package information and upgrade any outdated packages to their latest versions. Once the update process is complete, you are ready to move on to the next step.
Step 2. Installing SDKMAN.
To begin the installation process, you need to download the SDKMAN installation script. Open a terminal and execute the following command:
curl -s "https://get.sdkman.io" | bash
This command uses curl to download the installation script from the official SDKMAN website and pipes it directly to the bash shell for execution.
Once the installation script is downloaded, it will automatically start executing. The script will guide you through the installation process, prompting you for any necessary input or confirmations. Follow the on-screen instructions carefully, and provide the required information when asked.
Step 3. Configuring the Environment.
After the installation script finishes executing, you need to configure your shell environment to recognize and use SDKMAN. To do this, you need to source the SDKMAN initialization script. Run the following command:
source "$HOME/.sdkman/bin/sdkman-init.sh"
This command loads the SDKMAN initialization script into your current shell session, making the SDKMAN commands available for use.
To ensure that SDKMAN is automatically initialized in future shell sessions, you need to add the above command to your shell configuration file. If you are using Bash, open the ~/.bashrc
file, and if you are using Zsh, open the ~/.zshrc
file. Add the following line at the end of the file:
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
Save the file and close the editor. Your shell environment is now configured to use SDKMAN.
To verify that SDKMAN is installed correctly, you can run the following command:
sdk version
Step 4. Using SDKMAN on AlmaLinux 9.
Now that SDKMAN is installed and configured, you can start using it to manage your SDKs and development tools. Here are some basic commands to get you started:
- To list all available SDKs, use the command:
sdk list
- To install a specific SDK, use the command:
sdk install <sdk-name>
- To switch between different versions of an installed SDK, use the command:
sdk use <sdk-name> <version>
- To set a default version of an SDK, use the command:
sdk default <sdk-name> <version>
- To set a default version of an SDK, use the command:
sdk default <sdk-name> <version>
- To update an installed SDK to the latest version, use the command:
sdk update <sdk-name>
- To remove an installed SDK, use the command:
sdk uninstall <sdk-name>
These are just a few examples of the commands available in SDKMAN. You can explore more options and functionalities by referring to the official SDKMAN documentation.
Congratulations! You have successfully installed SDKMAN. Thanks for using this tutorial for installing the SDKMAN on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official SDKMAN website.