Yes you can.

You should use the SDK Man software. curl -s "https://get.sdkman.io" | bash

When doing the sdk list java, you will get a screen like this:

=============================================================================== Available Java Versions for Linux 64bit ================================================================================ Vendor | Use | Version | Dist | Status | Identifier -------------------------------------------------------------------------------- Corretto | | 21.0.2 | amzn | | 21.0.2-amzn
| | 21.0.1 | amzn | | 21.0.1-amzn
| | 17.0.10 | amzn | | 17.0.10-amzn
| | 17.0.9 | amzn | | 17.0.9-amzn
| | 11.0.22 | amzn | | 11.0.22-amzn
| | 11.0.21 | amzn | | 11.0.21-amzn
| | 8.0.402 | amzn | | 8.0.402-amzn
| | 8.0.392 | amzn | | 8.0.392-amzn Dragonwell | | 17.0.9 | albba | | 17.0.9-albba
| | 11.0.21 | albba | | 11.0.21-albba
| | 11.0.20 | albba | | 11.0.20-albba
| | 8.0.402 | albba | | 8.0.402-albba
| | 8.0.392 | albba | | 8.0.392-albba
| | 8.0.382 | albba | | 8.0.382-albba Gluon | | 22.1.0.1.r17 | gln | | 22.1.0.1.r17-gln
| | 22.1.0.1.r11 | gln | | 22.1.0.1.r11-gln GraalVM CE | | 21.0.2 | graalce | | 21.0.2-graalce
| | 21.0.1 | graalce | | 21.0.1-graalce
| | 17.0.9 | graalce | | 17.0.9-graalce GraalVM Oracle| >>> | 21.0.2 | graal | installed | 21.0.2-graal
| | 21.0.1 | graal | | 21.0.1-graal
| | 17.0.10 | graal | | 17.0.10-graal
| | 17.0.9 | graal | | 17.0.9-graal

First of all you should install all the different version by: sdk install java yourVersion like sdk install java 21.0.1-graalce or sdk install java 17.0.9-graalce or sdk install java 23.ea.12-open.

This allows you to go to a directory and do sdk use java 21.0.1-graalce.

This will activate the JDK 21 version of the GraalVM CommunityEdition (CE). You can do this for different version in different directories.

Answer from Mahir Zukic on Stack Overflow
🌐
Oracle
oracle.com › java › technologies › downloads
Download the Latest Java LTS Free
Download the Java including the latest version 17 LTS on the Java SE Platform. These downloads can be used for any purpose, at no cost, under the Java SE binary code license.
🌐
SDKMAN!
sdkman.io › usage
Usage | SDKMAN! the Software Development Kit Manager
Setting java 21.0.4-tem as default. Need a specific version of an SDK? Simply qualify the version you require: ... All subsequent steps same as above. Using a snapshot version? Already have a local installation?
Discussions

Getting started with SDKMAN! – Manage Java, Maven, Gradle versions with ease
I love sdkman!!! sdk install java 23.0.2-amzn sdk install maven sdk install gradle so easy!!! More on reddit.com
🌐 r/java
39
85
April 20, 2025
Installing jdk with sdkman keeps reporting errors
Question When I use rockylinux version 9 and use sdkman to install java, it reports the same error no matter what version is installed, I don't know why this problem occurs, and I am asking for the community's help, the specific error message and system version information is in the following ... More on github.com
🌐 github.com
13
April 8, 2024
🌐
Oracle
oracle.com › java › technical details › java se
Java(TM) SDK, Standard Edition 1.3.1_10 Installation Notes
If you have any difficulties, see the Troubleshooting section at the end of this document or use this link to report an installation problem. Note: For any lines on this page containing the following notation, you must substitute the appropriate update version number for the notation. ... Before you download a file, notice that its byte size is provided on the download page. Once the download has completed, check that you have downloaded the full, uncorrupted software file. ... The file j2sdk-1_3_1_<version number>-windows-i586.exe is the Java 2 SDK installer.
Top answer
1 of 3
4

Yes you can.

You should use the SDK Man software. curl -s "https://get.sdkman.io" | bash

When doing the sdk list java, you will get a screen like this:

=============================================================================== Available Java Versions for Linux 64bit ================================================================================ Vendor | Use | Version | Dist | Status | Identifier -------------------------------------------------------------------------------- Corretto | | 21.0.2 | amzn | | 21.0.2-amzn
| | 21.0.1 | amzn | | 21.0.1-amzn
| | 17.0.10 | amzn | | 17.0.10-amzn
| | 17.0.9 | amzn | | 17.0.9-amzn
| | 11.0.22 | amzn | | 11.0.22-amzn
| | 11.0.21 | amzn | | 11.0.21-amzn
| | 8.0.402 | amzn | | 8.0.402-amzn
| | 8.0.392 | amzn | | 8.0.392-amzn Dragonwell | | 17.0.9 | albba | | 17.0.9-albba
| | 11.0.21 | albba | | 11.0.21-albba
| | 11.0.20 | albba | | 11.0.20-albba
| | 8.0.402 | albba | | 8.0.402-albba
| | 8.0.392 | albba | | 8.0.392-albba
| | 8.0.382 | albba | | 8.0.382-albba Gluon | | 22.1.0.1.r17 | gln | | 22.1.0.1.r17-gln
| | 22.1.0.1.r11 | gln | | 22.1.0.1.r11-gln GraalVM CE | | 21.0.2 | graalce | | 21.0.2-graalce
| | 21.0.1 | graalce | | 21.0.1-graalce
| | 17.0.9 | graalce | | 17.0.9-graalce GraalVM Oracle| >>> | 21.0.2 | graal | installed | 21.0.2-graal
| | 21.0.1 | graal | | 21.0.1-graal
| | 17.0.10 | graal | | 17.0.10-graal
| | 17.0.9 | graal | | 17.0.9-graal

First of all you should install all the different version by: sdk install java yourVersion like sdk install java 21.0.1-graalce or sdk install java 17.0.9-graalce or sdk install java 23.ea.12-open.

This allows you to go to a directory and do sdk use java 21.0.1-graalce.

This will activate the JDK 21 version of the GraalVM CommunityEdition (CE). You can do this for different version in different directories.

2 of 3
0

For support purposes I have multiple versions of Java installed all the time. Namely, I have:

  • Oracle Java 6
  • Oracle Java 7
  • Oracle Java 8
  • Oracle Java 11
  • OpenJDK 11
  • OpenJDK 17
  • OpenJDK 21

Yes, I have two Java 11 from different sources.

You can download the packages separately and decompress them. This stategy avoids using the installers since they will try to manage the system properties and set/reset their own versions as the "default one". You probably want to manage the default manually, not automatically.

Now, your folder will look like:

Copyjdk1.6.0_34
jdk1.7.0_40
jdk1.8.0_51
openjdk-11+28
java -> jdk-11+28  (this is a symlink)
...

The PATH variable includes the symlink folder only. This way I decide which java version to use by switching the java symlink -- that is pointing in this example to the OpenJDK 11. If I want to use Java 6, I can repoint the symlink by doing:

Copyrm java
ln -s jdk1.6.0_34 java

Easy, isn't it?

Finally, most IDEs can make this change a lot easier, but I wanted to show you the manual way of doing things, so you can understand there's no magic behind it.

🌐
Oracle
java.com › en › download › manual.jsp
Download Java
This download is for end users who need Java for running applications on desktops or laptops. Java 8 integrates with your operating system to run separately installed Java applications.
🌐
GeeksforGeeks
geeksforgeeks.org › java › download-and-install-jdk-on-windows-mac-and-linux
Download and Install JDK on Windows, Mac and Linux - GeeksforGeeks
April 4, 2026 - C:\Program Files\Java\jdk-{YOUR_JDK_VERSION}. Click on OK => OK => OK. ... Follow the steps below to install the Java software Development Kit on a Linux environment.
Find elsewhere
🌐
IBM
ibm.com › docs › en › was-liberty › nd
Installing, updating, and uninstalling the Java SDK
You can install a Java software development kit (SDK) by using IBM Installation Manager Version 1.8.5 or later. Liberty can run with any compliant Java runtime environment (JRE) or Java SDK.
🌐
Microsoft Learn
learn.microsoft.com › en-us › java › openjdk › install
Install the Microsoft Build of OpenJDK | Microsoft Learn
Reinstall Oracle Java if you need to restore the Oracle registry keys. Run the EXE file from the command line. Use the selected features, as shown in the following example. .\<package>.exe /SILENT /SUPPRESSMSGBOXES /ALLUSERS /TASKS="FeatureEnvironment,FeatureJarFileRunWith" /DIR="C:\Program Files\Microsoft\" ... If installing for only the current user, use the flag /CURRENTUSER instead of /ALLUSERS.
🌐
Medium
medium.com › @zorozeri › manage-java-version-using-sdkman-including-maven-gradle-scala-kotlin-and-many-more-82532be9437e
Manage Java Version using SDKMAN! (including Maven, Gradle, Scala, Kotlin… and many more!) | by Ahmad Azeri Chandra Bhuana | Medium
January 16, 2025 - However, we can manually add it, so it would appear on response command sdk list java. This is actually explained by SDKMAN! Usage Page explanation : https://sdkman.io/usage#install-local-versions
🌐
IBM
ibm.com › docs › en › was › 9.0.5
Installing and updating IBM SDK, Java Technology Edition ...
IBM SDK, Java Technology Edition, Version 8 is the Java SDK version for WebSphere Application Server Version 9.0. IBM SDK, Java Technology Edition is no longer embedded with any WebSphere Application Server offerings. The Java SDK is available as a separate offering that must be installed when ...
🌐
Quora
quora.com › How-do-I-download-and-install-Java-SDK-in-Windows
How to download and install Java SDK in Windows - Quora
Answer (1 of 2): 1. Go to Java SE Development Kit 8 2. Under the Java SE Development Kit heading, click on Accept license agreement. 3. Then click on the download link against Windows x86 or Windows x64 depending upon your windows architecture. 4. Java sdk will be downloaded. Click on the downloa...
🌐
Baeldung
baeldung.com › home › devops › guide to sdkman!
Guide to SDKMAN! | Baeldung
November 13, 2025 - Therefore, we copy its identifier, which is the version from the table, and we add it as an argument in the install command: $ sdk install java 14.0.2-zulu Downloading: java 14.0.2-zulu In progress...
🌐
SDKMAN!
sdkman.io
Home | SDKMAN! the Software Development Kit Manager
Think of it as your helpful toolkit friend, ready to streamline SDK management for you. 🛠️ · Get started now! Go on then, paste and run the following in a terminal: ... Simplifying life. No more hunting for downloads, extracting archives, or tinkering with HOME and PATH environment variables. Install Software Development Kits for the JVM such as Java, Scala, Kotlin and Groovy.
🌐
Oracle
java.com › en › download › help › windows_manual_download.html
How do I manually download and install Java for my Windows computer?
Use these simple instructions to manually download and install Java (also known as Java Runtime Environment or JRE) for your Windows computer
🌐
Reddit
reddit.com › r/java › getting started with sdkman! – manage java, maven, gradle versions with ease
r/java on Reddit: Getting started with SDKMAN! – Manage Java, Maven, Gradle versions with ease
April 20, 2025 -

I put together a beginner-friendly guide on SDKMAN!, a super handy tool for managing parallel versions of Java SDKs, Maven, Gradle, and many other development tools right from your terminal.

If you've ever struggled with switching between Java versions for different projects, SDKMAN! can really simplify your workflow.

In the post, I cover:

  • What SDKMAN! is and why it’s useful.

  • How to install it.

  • How to install and switch between SDKs.

  • Tips for setting a default version.

Hope it helps someone!

🌐
OpenJDK
openjdk.org
OpenJDK
Learn about the key active Projects in the Community including Amber (high-productivity language features), Babylon (foreign programming models), Leyden (better startup and warmup), Loom (lightweight concurrency), Panama (foreign functions and foreign data), Valhalla (primitive types and ...
🌐
AWS
docs.aws.amazon.com › aws sdk for java › developer guide for version 1.x › getting started › ways to get the aws sdk for java
Ways to get the AWS SDK for Java - AWS SDK for Java 1.x
We recommend that you migrate to the AWS SDK for Java 2.x to continue receiving new features, availability improvements, and security updates. ... You must be able to sign in to the AWS access portal available in the AWS IAM Identity Center. A suitable installation of Java.
🌐
Box
developer.box.com › guides › tooling › sdks › java
Install Java SDK - Box Dev Docs
Use this file to discover all available pages before exploring further.You can use Box Java SDK to call Box APIs in a Java project. To install Java SDK, add a Gradle dependency or Maven dependency, or clone the source into a project.
🌐
GitHub
github.com › sdkman › sdkman-cli › issues › 1285
Installing jdk with sdkman keeps reporting errors · Issue #1285 · sdkman/sdkman-cli
April 8, 2024 - Question When I use rockylinux version 9 and use sdkman to install java, it reports the same error no matter what version is installed, I don't know why this problem occurs, and I am asking for the community's help, the specific error message and system version information is in the following ...
Author   sdkman