The Problem: The Nightmare of Managing Java Versions on Linux
You’ve likely been there: maintaining a Java 8 project in the morning, attending a Java 11 meeting in the afternoon (much like the complexity of deploying JavaScript applications), and wanting to experiment with the latest Java 21 at night. If you install Java directly via DNF, switching between versions is a nightmare. You’ll find yourself struggling with the alternatives command or manually editing JAVA_HOME in .bashrc every time you switch projects.
In reality, Fedora prioritizes operating system stability over developer flexibility. Fedora’s OpenJDK packages are great for running system applications, but they aren’t designed for developers who need to “hop” between versions constantly while coding. It’s part of the process of setting up a clean and secure server.
Why Use SDKMAN! Instead of the Traditional Way?
Take a look at the comparison table below to see the difference in environment management:
| Criteria | Using DNF (Fedora Repo) | Manual Download (.tar.gz) | Using SDKMAN! |
|---|---|---|---|
| Installation Speed | Fast (1 command) | Slow (extract, set path) | Very fast (1 command) |
| Version Switching | Difficult (requires long commands) | Very difficult (edit config files) | Takes 2 seconds (1 command) |
| Version Repository | Limited (OpenJDK only) | Manual search on web | Over 100 builds (Oracle, Zulu, Temurin…) |
Based on my two years of using Fedora, I recommend completely separating your coding environment from the OS. This approach is similar to setting up a professional Go (Golang) development environment, where isolation is key. I use SDKMAN! to manage JDKs and JetBrains Toolbox to manage IDEs. This approach keeps your system clean.
Step 1: Install SDKMAN! in a Heartbeat
SDKMAN! is a powerful command-line tool for installing and switching between hundreds of SDKs. First, install zip and unzip as SDKMAN! requires them to extract JDK packages:
sudo dnf install zip unzip curl
Next, run the automatic installation script:
curl -s "https://get.sdkman.io" | bash
To start using it immediately without restarting your terminal, run:
source "$HOME/.sdkman/bin/sdkman-init.sh"
Pro tip: Type sdk version to check. If it displays a specific version, you’ve successfully installed it.
Step 2: Professional Multi-Version JDK Management
To see the extensive list of available Java versions, use the command: sdk list java. Suppose you need to install Java 17 and 21 from Temurin (Eclipse Adoptium) for their high stability:
# Install Java 17 LTS
sdk install java 17.0.10-tem
# Install the latest Java 21 LTS
sdk install java 21.0.2-tem
Want to quickly switch to Java 17 for an older project? Just type: sdk use java 17.0.10-tem. If you want every new terminal to use Java 21 by default, use the default command:
sdk default java 21.0.2-tem
Step 3: Install Maven and Gradle Synchronously
Don’t install Maven via DNF as the version is often outdated. Installing directly through SDKMAN! ensures Maven automatically detects the active JAVA_HOME, avoiding version conflict errors when building projects.
sdk install maven
sdk install gradle
Step 4: Install IntelliJ IDEA via JetBrains Toolbox
On Fedora, JetBrains Toolbox is the best way to manage IDEs. It allows you to upgrade versions with a single click, saving about 15 minutes compared to manually downloading .tar.gz files.
- Download JetBrains Toolbox from the official website.
- Extract and run the executable to install.
- Open Toolbox and select IntelliJ IDEA (Ultimate or Community) to install.
Important Tip: When configuring the Project SDK in IntelliJ, point the path to: /home/your-username/.sdkman/candidates/java/current. When you change the sdk default in the terminal, IntelliJ will automatically update without needing reconfiguration.
Step 5: Performance Optimization for Large Projects
Fedora uses a modern kernel, so JVM performance is excellent. Whether you are using a server edition or Fedora Workstation, the system handles resource-intensive tasks well. However, for heavy Microservices projects, you should increase the file limit (ulimit). Add the following lines to the end of the /etc/security/limits.conf file:
* soft nofile 65536
* hard nofile 65536
This helps avoid “Too many open files” errors when IntelliJ indexes thousands of files in large projects.
Conclusion
Combining SDKMAN! and IntelliJ IDEA on Fedora provides a coding experience as smooth as macOS. You no longer have to worry about environment variables or system clutter from old installation packages. Leverage the power of the Fedora terminal to optimize your workflow today.

