1. Create new custom variable that point to the preferred version

  2. Set %JAVA_HOME%/bin as first entry to Path Variable

  3. Profit!

    Check with java -version

Why not just remove the Oracle Java path entry and not worry about your JAVA_HOME placement in the Path?

You might suggest to simply remove the Oracle Java path that was prepended to your Windows PATH by the installer. Yes, I thought of that too, but the installer also copies the java.exe, javaw.exe, and javaws.exe files to C:\Windows\System32 directory, which is also in the Windows PATH variable. So rather than chase down all the possible directories that the installer put Java, and to avoid deleting the System32 files that actually may be necessary to some process somewhere, I decided that simply prepending my preferred Java Home directory to the path was best option.

Source: How to set custom Java path after installing JDK 8 โ€“ Douglas C. Ayers

Answer from Ooker on Stack Overflow
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ answers โ€บ questions โ€บ 850521 โ€บ how-to-downgrade-java-version-default-installed-in
How to downgrade Java version default installed into Azure Portal from Java 17 to Java 11 - Microsoft Q&A
May 16, 2022 - Open the Azure Portal and navigate to the App Service that is using Java 17. Click on the "Configuration" option in the left-hand menu. Under the "General settings" section, locate the "Java version" option and click on the "Edit" button next to it.
Discussions

How do I downgrade to openjdk 11?
Download adoptopenjdk and set java_home when you run spark. More on reddit.com
๐ŸŒ r/Fedora
4
5
May 14, 2022
How do I change my Java version from 17 to 8?
First: it's important to know that you can define Java versions on a per-instance basis. In other words: the Minecraft version(s) you play with can use completely different Java versions than the main version which you use for Prism itself. Even better: you don't have to install these Java runtimes, you can basically unpack them somewhere and then point Prism (or your individual Minecraft instances) to 'm. So... hop on over to the Oracle Java download page , scroll down a bit and you'll notice links for Java SE 8 (in specific: 8u411 at the time of writing). Be sure to select the right tab for your OS! Now, I'd recommend downloading an archive; a zip file. Then, when done, extract this in an easy to find location. For example... I dumped all 3 required Java versions into "c:\program files\java\(version)". Of course you can also simply install the new Java version so that you can rely on Prism's auto detect feature, up to you. Once you're done select your Minecraft instance in Prism and cilck "Edit" (see the menu on the right side of the screen). Go to the "Settings" tab and you should see the Java settings for that particular instance. Enable Java installation, and then either use the auto detect option, or point Prism to the new "java.exe" yourself. Once that's out of your way you're all good to go! Hope this can help. More on reddit.com
๐ŸŒ r/PrismLauncher
4
3
June 13, 2024
How do I downgrade JDK?
$ sudo apt remove openjdk-16-jdk $ sudo apt update && sudo apt install openjdk-11-jdk More on reddit.com
๐ŸŒ r/linux4noobs
9
7
August 30, 2021
How to downgrade Java in Debian?
Thanks for being a part of | r/Admincraft | ! | We'd love it if you also joined us on Discord! Join thousands of other Minecraft administrators for real-time discussion of all things related to running a quality server. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
๐ŸŒ r/admincraft
7
3
August 23, 2022
๐ŸŒ
HappyCoders.eu
happycoders.eu โ€บ java โ€บ how-to-switch-multiple-java-versions-windows
How to Change Java Versions in Windows (up to Java 25)
June 11, 2025 - More info: https://stackoverflow.com/questions/5492937/windows-ignores-java-home-how-to-set-jdk-as-default/69913509#69913509 ... hi mam this is a real help as a minecraft dev I am still coding in 1.17.1 and was planning to shift on 1.18 but both have a different jdk and thanks to you no i can switch between jdk version and use spigot
๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ downgrading-java-17-11-mariรกn-varga
Downgrading Java 17 to Java 11
July 21, 2021 - However, the gap between Java 8 and the latest Java versions is already quite big and it keeps growing: compact modular JRE, garbage collection improvements, Strings using 1 byte/character if possible to name just a few improvements from Java 8. So my suggestion is, stop sticking to Java 8 (from 2014) and while you can still use Java 11 as a middle ground, try to get rid of Java 8 in favour of a newer version like Java 17.
๐ŸŒ
Medium
medium.com โ€บ miro-engineering โ€บ how-to-switch-between-java-lts-versions-8-11-and-17-on-mac-cb6717d1272
How to switch between Java LTS versions 8, 11, and 17 on Mac | by Lothar Schulz | Miro Engineering | Medium
November 25, 2021 - Now you can change the java version on the terminal using the respective alias: $ j17 openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment Homebrew (build 17.0.1+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.1+0, mixed mode, sharing)$ j11 openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment Homebrew (build 11.0.12+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)$ j1.8 openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-bre_2021_10_20_23_15-b00) OpenJDK 64-Bit Server VM (build 25.312-b00, mixed mode)
Top answer
1 of 1
3

You have two options ahead of you:

  1. You can uninstall JDK-16.0.2, then install OpenJDK 11 and have just that implementation on your system
  2. You can install OpenJDK 11 and use update-alternatives to specify which version you want to be treated as default

This answer will focus on the second option, though you can modify it to work for the first.

  1. Open a Terminal (if one is not already open) or SSH into the server you're installing Java onto
  2. Install the default Java runtime. For Ubuntu 20.04, this is version 11.0.11:
    sudo apt install default-jre
    
    If you want to be absolutely certain of the version, you can also specify the version:
    sudo apt install openjdk-11-jre-headless
    
  3. Install the default Java Development Kit:
    sudo apt install default-jdk
    
  4. Confirm the versions:
    java -version
    
    This should give you something like:
    openjdk version "11.0.11"
    OpenJDK Runtime Environment (build 11.0.11+9-post-Ubuntu-3ubuntu1)
    OpenJDK 64-Bit Server VM (build 11.0.11+9-post-Ubuntu-3ubuntu1, mixed mode, sharing)
    
    Also check the compiler:
    javac -version
    
    Which will give you something like:
    javac 11.0.11
    
  5. Set version 11 as the default for the system:
    sudo update-alternatives --config java
    
    This will give you an output similar to:
    There are 2 choices for the alternative java (providing /usr/bin/java).
    
      Selection    Path                                         Priority   Status
      --------------------------------------------------------------------------------
      0            /usr/lib/jvm/java-16-openjdk-amd64/bin/java   1111      auto mode
      1            /usr/lib/jvm/java-16-openjdk-amd64/bin/java   1111      manual mode
    * 2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1091      manual mode
    
    Press <enter> to keep the current choice[*], or type selection number:
    
    You can also do this for the compiler with:
    sudo update-alternatives --config javac
    
  6. Confirm your JAVA_HOME variable is correct:
    sudo vi /etc/environment
    
    Note: Feel free to use any text editor that you prefer. The use of vi here is more a force of habit than an endorsement. Locate the JAVA_HOME variable and ensure it's set correctly:
    JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
    
    Reload your sources:
    source /etc/environment
    
    Verify the variable is set:
    echo $JAVA_HOME
    
    You should see:
    /usr/lib/jvm/java-11-openjdk-amd64
    

That's all there is to it ๐Ÿ‘๐Ÿป

Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/fedora โ€บ how do i downgrade to openjdk 11?
r/Fedora on Reddit: How do I downgrade to openjdk 11?
May 14, 2022 -

The title says it all. I have a software (Apache spark) that runs on Java 8/11, but my system runs on Java 17. So I need to downgrade.

Which also arises a second question. If i run that program as second user will it only modify these settings in that user or all globally?

๐ŸŒ
Lotharschulz
lotharschulz.info โ€บ 2021 โ€บ 11 โ€บ 30 โ€บ how-to-switch-between-java-lts-versions-8-11-and-17-on-mac
How to switch between Java LTS versions 8, 11 and 17 on Mac โ€“ Lothar Schulz
Now you can change the java version on the terminal using the respective alias: $ j17 openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment Homebrew (build 17.0.1+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.1+0, mixed mode, sharing) $ j11 openjdk version "11.0.12" 2021-07-20 ...
๐ŸŒ
Customer Support
support.quotemedia.com โ€บ support โ€บ solutions โ€บ articles โ€บ 13000055272-how-to-downgrade-java-version-windows-user-
How to Downgrade Java Version (Windows User) : Customer Support
September 19, 2018 - - You can choose to order this list alphabetically by clicking the Name Bar. Locate Java on this list and select Uninstall (Note: You may have multiple versions, if so, please contact our Support Department for assistance on which version to remove)
๐ŸŒ
University of Oregon
service.uoregon.edu โ€บ TDClient โ€บ KB โ€บ ArticleDet
Reverting to a Previous Version of Java (Windows)
July 16, 2017 - This page explains how to uninstall your current version of Java and then install an older version. Users of Banner and AppWorx job scheduling may need to revert to an older version of Java if they've installed a new version that's incompatible with those services.
๐ŸŒ
Linux Mint Forums
forums.linuxmint.com โ€บ board index โ€บ main edition support โ€บ software & applications
[SOLVED] How to downgrade Java version - Linux Mint Forums
April 24, 2019 - I followed various instructions online as to how to do this but none of them work: http://tipsonubuntu.com/2016/07/31/inst ... x-mint-18/ Is there not a simple way using the Package Manager to downgrade Java version? Thanks! Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total. Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed. ... Are you quite sure that you need version 8? Usually, Java/OpenJDK is fully backwards compatible. So version 11 should do the job as well.
๐ŸŒ
Reddit
reddit.com โ€บ r/prismlauncher โ€บ how do i change my java version from 17 to 8?
r/PrismLauncher on Reddit: How do I change my Java version from 17 to 8?
June 13, 2024 -

I downloaded Prism Launcher because I wanna play beta 1.7.3 but it wonโ€™t let me because iโ€™m on Java 17

๐ŸŒ
YouTube
youtube.com โ€บ code with arjun
How to switch between the multiple Java versions(JDK) in windows 10 | Switch between java 8,11,15,17 - YouTube
In this Video i am going to show how to switch or manage the multiple java versions of jdk versions at a time in windows operating system. If you have java 8...
Published ย  June 25, 2021
Views ย  145K
๐ŸŒ
Quora
quora.com โ€บ How-do-I-downgrade-Java-on-Mac
How to downgrade Java on Mac - Quora
Answer: You can install multiple versions of the JDK simultaneously. Look in /Library/Java/JavaVirtualMachines/ to see which versions are currently installed. There is a folder named CurrentJDK, which is actually a symbolic link to one of the other folders. Remove it and create a new symbolic ...
๐ŸŒ
Linux Mint Forums
forums.linuxmint.com โ€บ board index โ€บ interests โ€บ programming & development
Downgrading java - Linux Mint Forums
ajgringo619 wrote: Mon Jun 28, 2021 3:54 pm For this particular game, change java to /usr/lib/jvm/java-8-openjdk-amd64/bin/java. This way you won't affect the rest of your programs. Thank you very much!
๐ŸŒ
Aviator
aviator.co โ€บ home โ€บ blog โ€บ java version upgrade: a hands-on guide from java 8 to 17
Java Version Upgrade: A Hands-on Guide from Java 8 to 17 - Aviator Blog
April 30, 2025 - Nashorn JavaScript Engine Deprecated in Java 11 and removed in Java 15. Fix: Use alternatives like GraalVM JavaScript if scripting is required. CORBA, Java EE modules (java.activation, java.xml.ws, etc.) All have been removed. Fix: These need external libraries now, often via Maven or Gradle. Your build system might be coupled with Java 8-specific tooling or plugin versions. Migration requires checking compatibility across your stack: ... Ensure youโ€™re on Maven 3.8+ for full Java 17 compatibility.
๐ŸŒ
Android Developers
developer.android.com โ€บ android studio โ€บ java versions in android builds
Java versions in Android builds | Android Studio | Android Developers
> Android Gradle plugin requires Java 17 to run. You are currently using Java 11. Your current JDK is located in /usr/local/buildtools/java/jdk You can try some of the following options: - changing the IDE settings.