How To Install SDKMAN on Rocky Linux 10
Managing multiple Software Development Kits across different projects remains one of the most challenging aspects of modern development workflows. Developers often struggle with manually downloading SDK archives, configuring environment variables, and switching between versions for different projects. SDKMAN (Software Development Kit Manager) eliminates these pain points by providing a unified command-line interface for installing, managing, and switching between various SDKs on Unix-based systems. Rocky Linux 10, as a robust enterprise-grade distribution, offers an ideal environment for development workflows requiring multiple SDK versions. This comprehensive guide walks through the complete installation process of SDKMAN on Rocky Linux 10, from initial system preparation to advanced usage techniques, troubleshooting tips, and best practices for efficient SDK management.
Understanding SDKMAN
What is SDKMAN?
SDKMAN is an open-source command-line tool that revolutionizes how developers manage SDKs on Unix-based systems. Originally created by Marco Vermeulen, this powerful utility addresses the common pain points of manually downloading, installing, and switching between different SDK versions. The tool supports an extensive collection of popular SDKs including Java, Scala, Kotlin, Groovy, Maven, Gradle, SBT, Spring Boot, and over 50 other development tools. This comprehensive support makes it invaluable for polyglot development environments where multiple languages and build tools coexist.
SDKMAN’s core functionality revolves around three key operations: listing available SDKs, installing specific versions, and switching between them effortlessly. The tool maintains a centralized repository of SDK binaries, ensuring users access verified, secure downloads from official sources. Unlike manual installation methods that require downloading archives, extracting files, and configuring environment variables, SDKMAN automates these processes through simple commands. It handles path management, version switching, and cleanup operations seamlessly, reducing human error and ensuring consistent development environments across team members.
Key Benefits of SDKMAN
The advantages of using SDKMAN extend far beyond simple convenience. First, it dramatically simplifies SDK installation and version control processes. Developers can install any supported SDK with a single command rather than navigating multiple websites and documentation pages. Second, SDKMAN automatically manages environment variables, eliminating the need for manual PATH configuration and reducing configuration errors. Third, the tool eliminates tedious manual download and configuration processes, saving valuable development time.
SDKMAN works seamlessly across multiple platforms including macOS, Linux, and Windows Subsystem for Linux (WSL). It features an offline mode capability that ensures functionality even without internet connectivity, making it perfect for secure or air-gapped environments. The tool increases developer productivity by reducing setup time from hours to minutes, allowing teams to onboard new developers rapidly and maintain standardized development environments.
About Rocky Linux 10
Overview of Rocky Linux 10
Rocky Linux stands as an enterprise-grade, RHEL-compatible Linux distribution designed for production environments. Rocky Linux 10.0, codenamed “Red Quartz,” delivers stability, security, and long-term support for professional development and production deployments. The distribution targets enterprise environments, developers, and production servers requiring reliable, tested software packages. Its compatibility with Red Hat Enterprise Linux ensures access to extensive documentation, community support, and enterprise software compatibility.
System Architecture Requirements
Rocky Linux 10 introduces specific architectural requirements that differentiate it from previous versions. The distribution requires x86_64-v3 microarchitecture, meaning systems must use Intel Haswell processors (or newer) or AMD Excavator processors (or newer). Minimum processor requirements specify hardware from 2013 or later. CPU feature requirements include AVX, AVX2, BMI1/2, and FMA instruction set support. The distribution also supports additional architectures including aarch64, ppc64le, s390x, and riscv64 for diverse hardware environments.
Prerequisites and System Requirements
Minimum Hardware Requirements
Before installing SDKMAN on Rocky Linux 10, ensure the system meets minimum hardware specifications. The system requires a 1 GHz 64-bit processor supporting x86_64-v3 architecture or equivalent. RAM requirements specify 2 GB minimum, though 4 GB is recommended for development environments running multiple applications simultaneously. Storage needs include at least 20 GB of available disk space for the operating system, SDKMAN, and multiple SDK installations. An active internet connection is necessary for initial installation and SDK downloads. Multi-core CPUs are recommended for optimal performance, especially when compiling large projects or running resource-intensive development tools.
Software Prerequisites
Several software components must be present before installing SDKMAN. The system must have Rocky Linux 10 installed and running properly. Root or sudo user access is required for installing system dependencies. Essential command-line tools include bash shell (version 3.0 or higher), curl for downloading installation scripts, zip and unzip utilities for archive management, and the which command for locating binaries. Updated system packages ensure compatibility and security. Terminal or SSH access provides the interface for executing installation commands.
Knowledge Requirements
While SDKMAN installation is straightforward, certain knowledge foundations prove helpful. A basic understanding of Linux command-line interface operations enables smooth installation and troubleshooting. Familiarity with terminal commands and file system navigation helps during configuration. Understanding environment variables, while helpful, is not strictly required as SDKMAN handles most configuration automatically. Basic text editor skills for reviewing and modifying configuration files enhance troubleshooting capabilities.
Step-by-Step Installation Guide
Step 1: Update System Packages
Begin the installation process by ensuring Rocky Linux 10 has the latest packages and security updates. System updates prevent compatibility issues and security vulnerabilities. Open a terminal and execute the following command to clean the DNF package manager cache:
sudo dnf clean all
This command removes cached package metadata and temporary files. Next, update all installed packages to their latest versions:
sudo dnf update -y
The update process downloads and installs available updates for all system packages. The -y
flag automatically answers “yes” to confirmation prompts, streamlining the process. Depending on the number of updates available, this process may take several minutes. After kernel updates, consider rebooting the system to ensure new kernel versions load properly:
sudo reboot
Step 2: Install Required Dependencies
SDKMAN requires several essential packages for proper operation. Install all necessary dependencies with a single command:
sudo dnf install -y curl zip unzip bash which
Each dependency serves a specific purpose in SDKMAN’s operation. The curl utility downloads installation scripts and SDK files from remote servers. The zip and unzip packages handle archive compression and extraction for SDK packages. Bash provides the required shell environment for SDKMAN execution, as the tool is written in bash script. The which command helps SDKMAN locate installed binaries in the system PATH.
After installation completes, verify that dependencies installed correctly by checking their versions:
curl --version
unzip -v
which bash
These commands confirm the tools are accessible and functioning properly.
Step 3: Download and Execute SDKMAN Installer
SDKMAN provides an official installation script that automates the entire setup process. The installer is cryptographically signed and verified by the SDKMAN development team to ensure security and authenticity. Execute the following command to download and run the installer:
curl -s "https://get.sdkman.io" | bash
This command performs several operations simultaneously. The curl -s
flag downloads the installation script in silent mode, suppressing progress information for cleaner output. The pipe operator (|
) redirects the downloaded script directly to bash for immediate execution.
During installation, the script displays progress information:
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
Extract script archive...
Install scripts...
Set version to something sensible...
Attempt update of login bash profile...
All done!
The installer automatically performs several critical tasks. It creates the SDKMAN directory structure in the user’s home folder at ~/.sdkman
. The script downloads and extracts necessary components. It sets up configuration files with sensible defaults. Most importantly, it updates the bash profile to ensure SDKMAN loads automatically in new terminal sessions. The typical installation completes within 1-2 minutes depending on network speed.
Step 4: Initialize SDKMAN in Current Shell
After installation completes, SDKMAN must be initialized in the current shell session to begin using it immediately. Execute the initialization command:
source "$HOME/.sdkman/bin/sdkman-init.sh"
This command loads SDKMAN functions and aliases into the current terminal session. The source command reads and executes commands from the specified file in the current shell context. This step is necessary only for the current terminal session; new terminal windows automatically load SDKMAN due to the bash profile integration.
The initialization script performs several operations. It exports the SDKMAN_DIR environment variable pointing to the installation directory. It loads SDKMAN’s bash functions, making the sdk
command available. It configures command completion for enhanced user experience. The script also checks for updates and initializes the candidate database.
Step 5: Verify Shell Profile Integration
SDKMAN’s installer automatically integrates with the shell profile to ensure it loads in every new terminal session. Verify this integration by examining the bash configuration file:
tail ~/.bashrc
The output should display SDKMAN initialization code at the end of the file:
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
This code block ensures SDKMAN loads automatically whenever a new bash shell starts. The comment emphasizes the importance of placement at the file’s end. The first line exports the SDKMAN_DIR variable defining the installation location. The second line checks if the initialization script exists and is not empty, then sources it. Understanding this integration helps troubleshoot issues where SDKMAN doesn’t load automatically.
Step 6: Verify Installation Success
Confirm SDKMAN installed correctly by checking its version:
sdk version
Successful installation displays version information in the following format:
SDKMAN!
script: 5.19.0
native: 0.5.0
The output shows two version numbers. The script version indicates the bash script version. The native version shows the native binary helper version. Both version numbers confirm SDKMAN is properly installed and functional.
Alternative verification methods include checking the help documentation:
sdk help
This command displays all available SDKMAN commands and usage information, confirming full functionality. If version or help commands fail, revisit previous installation steps to identify configuration issues.
Advanced Installation Options
Custom Installation Directory
Some scenarios require installing SDKMAN in a non-default location. System administrators might prefer system-wide installations accessible to multiple users. Organizations might enforce specific directory structures for security or compliance reasons. Custom installations require setting the SDKMAN_DIR environment variable before running the installer:
export SDKMAN_DIR="/opt/sdkman"
curl -s "https://get.sdkman.io" | bash
This configuration installs SDKMAN in /opt/sdkman
instead of the default ~/.sdkman
directory. After installation, ensure the initialization script sources from the custom location:
source "/opt/sdkman/bin/sdkman-init.sh"
System-wide installations require appropriate directory permissions. Create the installation directory with proper ownership before installation:
sudo mkdir -p /opt/sdkman
sudo chown $USER:$USER /opt/sdkman
Proxy Configuration for Corporate Environments
Corporate networks often route traffic through proxy servers for security and monitoring. SDKMAN respects standard HTTP proxy environment variables. Configure proxy settings before running the installer:
export http_proxy=http://proxy.company.com:8080
export https_proxy=http://proxy.company.com:8080
curl -s "https://get.sdkman.io" | bash
For authenticated proxies, include credentials in the URL:
export http_proxy=http://username:password@proxy.company.com:8080
export https_proxy=http://username:password@proxy.company.com:8080
Make proxy configuration persistent by adding export commands to ~/.bashrc
:
echo 'export http_proxy=http://proxy.company.com:8080' >> ~/.bashrc
echo 'export https_proxy=http://proxy.company.com:8080' >> ~/.bashrc
Test proxy connectivity before installation:
curl -I https://get.sdkman.io
Successful connectivity returns HTTP headers; failures indicate proxy configuration issues.
Basic SDKMAN Usage and Configuration
Essential SDKMAN Commands
SDKMAN provides intuitive commands for SDK management. List all available SDKs:
sdk list
This command displays every SDK candidate SDKMAN supports, including Java, Kotlin, Scala, Groovy, Gradle, Maven, and many others. List specific SDK versions:
sdk list java
The output shows all available Java distributions with vendor information, version numbers, and installation status. Install the latest stable version of an SDK:
sdk install java
This command installs the default recommended version. Install specific versions by specifying the version identifier:
sdk install java 21.0.2-amzn
Set a default version for all new shell sessions:
sdk default java 21.0.2-amzn
Switch versions temporarily in the current session only:
sdk use java 17.0.10-amzn
Uninstall SDK versions no longer needed:
sdk uninstall java 11.0.3-open
Installing Your First SDK (Java Example)
Java remains the most popular SDK managed through SDKMAN. Install the latest OpenJDK version:
sdk install java
SDKMAN automatically selects the recommended version and installs it. During installation, the tool downloads the SDK archive, extracts files, and configures environment variables. After installation completes, verify Java is accessible:
java --version
This command displays the installed Java version, confirming successful installation. To install a specific Java distribution, first list available options:
sdk list java
The list shows identifier formats like 21.0.2-amzn
(Amazon Corretto 21.0.2) or 17.0.10-oracle
(Oracle JDK 17.0.10). Install the desired version:
sdk install java 17.0.10-oracle
Updating SDKMAN
SDKMAN includes self-update functionality to ensure access to the latest features and SDK candidates. Update SDKMAN itself:
sdk selfupdate
This command checks for SDKMAN updates and installs them if available. Regular updates maintain compatibility with new SDK releases and bug fixes. SDKMAN also updates its candidate database automatically, but manual refreshes are possible:
sdk update
Force updates when automatic update checks fail:
sdk selfupdate force
Troubleshooting Common Issues
Permission Denied Errors
Permission errors typically occur when the installation directory lacks write permissions. Verify home directory permissions:
ls -ld $HOME
The output should show read, write, and execute permissions for the user. Correct permissions if necessary:
chmod 755 $HOME
SDKMAN installations should never require sudo for user-space installations. Using sudo during installation creates ownership issues that prevent normal operation. If permission errors persist, use a custom installation directory with proper ownership.
Network Connectivity Problems
Network issues prevent downloading installation scripts and SDK files. Test connectivity to SDKMAN servers:
curl -I https://get.sdkman.io
Successful connections return HTTP 200 status codes. Connection failures indicate several possible issues. Firewall configurations might block outbound connections to SDKMAN servers. DNS resolution problems prevent translating hostnames to IP addresses. Proxy configurations in corporate environments require explicit configuration. Network administrators can whitelist SDKMAN domains to resolve corporate network restrictions.
Missing Dependencies
Missing dependency errors occur when required packages are absent. Error messages indicate which packages need installation. Install dependencies individually:
sudo dnf install -y curl
sudo dnf install -y zip unzip
Verify package installation:
curl --version
unzip -v
These commands confirm successful installation and accessibility.
Command Not Found After Installation
“Command not found” errors after installation indicate shell profile issues. The shell profile might not have loaded properly. Manually source the initialization script:
source "$HOME/.sdkman/bin/sdkman-init.sh"
Opening a new terminal window triggers automatic profile loading. Check for syntax errors in .bashrc
:
bash -n ~/.bashrc
This command performs syntax checking without executing the file. Some installations require creating the tmp directory manually:
mkdir -p ~/.sdkman/tmp
Best Practices and Tips
Version Management Strategies
Effective SDK version management improves development workflow efficiency. Maintain project-specific Java versions using .sdkmanrc
files:
cd ~/my-project
sdk env init
This creates a .sdkmanrc
file specifying SDK versions for the project. Edit the file to specify versions:
java=17.0.10-oracle
gradle=8.1.1
Entering directories with .sdkmanrc
files triggers automatic version switching. Create shell aliases for frequently used versions:
alias java17="sdk default java 17.0.10-oracle"
alias java21="sdk default java 21.0.2-amzn"
Add aliases to .bashrc
for persistence. Document project SDK requirements in README files to ensure team consistency.
Maintenance and Updates
Regular SDKMAN maintenance ensures optimal performance. Update SDKMAN monthly to access new features and SDK candidates:
sdk selfupdate
Clean up unused SDK versions quarterly:
sdk uninstall java 11.0.19-amzn
Monitor disk space usage in the SDKMAN directory:
du -sh ~/.sdkman
Large installations consuming excessive space warrant cleanup. Flush cached files and temporary downloads:
sdk flush archives
sdk flush temp
Keep track of installed SDKs and versions:
sdk current
This command displays currently active SDK versions. Consider backing up the .sdkman
directory before major system changes.
Use Cases and Real-World Applications
Development Environment Scenarios
SDKMAN excels in multi-project development environments requiring different Java versions. Legacy applications might require Java 8, while modern microservices use Java 21. Developers switch between versions seamlessly without manual configuration. Team collaboration benefits from standardized SDK versions across development machines. Teams document required SDK versions in project repositories, and new team members install identical configurations quickly.
CI/CD pipeline integration leverages SDKMAN for automated build environments. Build scripts install specific SDK versions on-demand, ensuring consistent builds across environments. Testing applications across multiple SDK versions validates compatibility before release. Polyglot development environments benefit from managing Java, Scala, Kotlin, and Groovy SDKs simultaneously.
Enterprise Applications
Enterprise environments face unique SDK management challenges. Legacy applications require long-term support versions while new projects adopt cutting-edge releases. SDKMAN manages both scenarios efficiently without conflicts. Standardizing development environments across teams reduces configuration drift and “works on my machine” problems. Automated onboarding scripts install required SDKs for new developers, reducing onboarding time from days to hours. Compliance requirements often mandate specific SDK versions for security or licensing reasons. SDKMAN provides precise version control meeting these requirements. Supporting multiple runtime environments for different applications becomes manageable with SDKMAN’s version switching capabilities.
Uninstalling SDKMAN
Occasionally, SDKMAN removal becomes necessary for troubleshooting or system cleanup. Complete removal requires two steps. First, remove the SDKMAN directory:
rm -rf "$HOME/.sdkman"
This command deletes all SDKMAN files, installed SDKs, and configuration. Second, clean shell profile entries by editing ~/.bashrc
:
nano ~/.bashrc
Remove the SDKMAN initialization block:
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
Save the file and exit. Reload the shell configuration:
source ~/.bashrc
Verify complete removal:
sdk version
The command should return “command not found,” confirming successful uninstallation.
Congratulations! You have successfully installed SDKMAN. Thanks for using this tutorial for installing the SDKMAN managing parallel versions of Java SDKs on your Rocky Linux 10 system. For additional help or useful information, we recommend you check the official SDKMAN website.