Change your PATH variable so that it has the location of the jdk5/bin directory:

  1. Start -> Control Panel -> System -> Advanced
  2. Click on Environment Variables, under System Variables, find PATH, and click on it.
  3. In the Edit windows, modify PATH by adding the location of your jdk5/bin directory to the beginning. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the directory as the value.
  4. Close the window.
  5. Reopen Command prompt window, and run java -version
Answer from dogbane on Stack Exchange
Discussions

How do I switch between Java versions?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. 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/javahelp
13
11
March 20, 2023
How to change default Java version in windows-latest?
Select Topic Area Question Body I have a pkg that depends on Java 11 and checks that JAVA_HOME is set and the the command java is at least version 11. I see that the windows-latest comes with Java ... More on github.com
🌐 github.com
2
2
May 10, 2024
install java updates
The first thing you need to do ... you need to download for your copy of Windows. Which version of Java should I download for my 64-bit Windows operating system? http://www.java.com/en/download/faq/java_win64b... ... Uninstall older versions of JAVA you might have installed. Press Windows key + R ... Scroll through the list of installaed programs Select JAVA and click Change/Uninstall ... More on learn.microsoft.com
🌐 learn.microsoft.com
4
24
Switch between java versions with a command on Windows
So is there a way I can switch between my instaled jdks? For example if I have installed jdk8 and jdk16 I can run a batch file and switch the version… More on reddit.com
🌐 r/javahelp
14
3
September 21, 2021
🌐
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 - Some programs, such as Eclipse, define the Java version in a separate configuration file (for Eclipse, for example, this is the entry "-vm" in the eclipse.ini file). The Java installers create various environment variables, which you need to clean up first (see below). The fastest way to change the environment variables is to press the Windows key and type "env" – Windows then offers "Edit the system environment variables" as a search result:
🌐
Medium
medium.com › @pabasarapasindu365 › effortlessly-switch-between-multiple-java-versions-in-the-same-command-prompt-on-windows-03adc8d1e96e
Effortlessly Switch Between Multiple Java Versions in the Same Command Prompt on Windows.
July 18, 2024 - Now you need to write code into these files. Fo r Example: echo off set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202 set PATH=%JAVA_HOME%\bin;%PATH% echo Java Version java -version
🌐
Oracle
java.com › en › download › help › update_runtime_settings.html
Update Java runtime settings on Windows
Verify that the latest Java Runtime version is enabled by checking the Enabled box. ... Click OK in Java Control Panel window to confirm changes and close the window.
🌐
University of Oregon
service.uoregon.edu › TDClient › 2030 › Portal › KB › ArticleDet
Reverting to a Previous Version of Java (Windows)
Please note these instructions focus on Java 8. ... In Windows 10 click in the search box on the bottom left corner of the taskbar (either Cortana or the magnifying glass) and type Control Panel.
Find elsewhere
🌐
GitHub
github.com › orgs › community › discussions › 123161
How to change default Java version in windows-latest? · community · Discussion #123161
May 10, 2024 - - name: configure_java uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' - name: validate java config shell: powershell run: | java --version echo $ENV:JAVA_HOME ... openjdk 11.0.23 2024-04-16 OpenJDK Runtime Environment Temurin-11.0.23+9 (build 11.0.23+9) OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (build 11.0.23+9, mixed mode) C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.23-9\x64 · Beta Was this translation helpful? Give feedback. ... Sign up for free to join this conversation on GitHub.
Top answer
1 of 4
2

Try manually installing it.

This is what i normally do.

https://www.java.com/en/download/help/windows_m...

Note: This is a non-Microsoft website. The page appears to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.

2 of 4
1

The first thing you need to do is determine which version of JAVA you need to download for your copy of Windows.

Which version of Java should I download for my 64-bit Windows operating system?

http://www.java.com/en/download/faq/java_win64b...

Troubleshoot installation

Uninstall older versions of JAVA you might have installed.

Press Windows key + R

Type: appwiz.cpl

Hit Enter

Scroll through the list of installaed programs

Select JAVA and click Change/Uninstall on the command bar

Restart your system



Disable your third party Antivirus you might have installed prior to updating.

Do a clean boot. http://support.microsoft.com/kb/929135



Reset your web browser to its default factory state and try again.

In Internet Explorer, click Tools or Alt + X

Click Internet Options

Go to the Advanced (tab)

Under Reset Internet Explorer settings, click 'Reset'

Try installing again

If you encounter download errors: 1305, 2755, 1606, see

http://www.java.com/en/download/help/error_inst...

Work around

http://java.com/en/download/help/index_installi...

Download the appropriate java setup file

Save it to your hard disk.

Disconnect your computer from the Internet, this includes disconnecting Ethernet cable or disconnect your wireless connection.

Install JAVA from the setup file.

Restart your computer

Reconnect to the Internet and JAVA should be installed.
🌐
Docker Hub
hub.docker.com › _ › openjdk
openjdk - Official Image | Docker Hub
3 weeks ago - For all currently supported OpenJDK versions this is turned on by default. Inside Windows Server (non-Hyper-V) containers, the limit for the number of available CPU cores doesn't work (it's ignored by Host Compute Service). To set the limit manually the JVM can be started as: $ start /b /wait /affinity 0x3 path/to/java...
🌐
Oracle
jdk.java.net › 25
JDK 25 Releases
JDK 25 has been superseded. Please visit jdk.java.net for the current version. Older releases, which do not include the most up to date security vulnerability fixes and are no longer recommended for use in production, remain available in the OpenJDK Archive.
🌐
Bell Software
bell-sw.com › blog › updating-the-java-version
How to update Java: A comprehensive guide
September 5, 2024 - msiexec /i bellsoft-jdk21.0.3+12-windows-amd64.msi /qn /quiet /norestart /l*v "Liberica_install.log" The second option is to download the .zip file, unpack JDK and set the PATH and JAVA_HOME environment variables as described in the section above. You may want to delete the previously installed version to save space.
🌐
Visual Studio Code
code.visualstudio.com › docs › java › java-tutorial
Getting Started with Java in VS Code
November 3, 2021 - For other operating systems, you will need to manually install a JDK, VS Code, and Java extensions. If you are an existing VS Code user, you can also add Java support by installing the Extension Pack for Java, which includes these extensions: ... The Extension Pack for Java provides a Quick Start guide and tips for code editing and debugging. It also has a FAQ that answers some frequently asked questions. Use the command Java: Tips for Beginners from the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) to launch the guide.
🌐
Reddit
reddit.com › r › minecraftseeds
r/minecraftseeds
February 22, 2011 - A seed made on Java edition won't work for Bedrock, or vise-versa. Biomes are consistent between the two but not structures. Correct flairs are important to prevent users loading into game just to find the seed won’t work for their version.
🌐
Jenkins
jenkins.io › doc › book › installing › linux
Linux
sudo apt update sudo apt install fontconfig openjdk-21-jre java -version · If the installation was successful, you should see an output similar to the following:
🌐
Junit
docs.junit.org › 6.0.3 › overview.html
Overview :: JUnit User Guide
April 7, 2026 - Note, however, that the JUnit Vintage engine is deprecated and should only be used temporarily while migrating tests to JUnit Jupiter or another testing framework with native JUnit Platform support. JUnit requires Java 17 (or higher) at runtime. However, you can still test code that has been compiled with previous versions of the JDK.
🌐
JetBrains
jetbrains.com › help › idea › installation-guide.html
Install IntelliJ IDEA | IntelliJ IDEA Documentation
April 17, 2026 - However, to develop Java applications, a standalone JDK is required. IntelliJ IDEA configurations with modified JRE/JDK are not supported. Installations of IntelliJ IDEA with manually removed or changed distribution files (e.g., plugin files) are not supported. The JetBrains Toolbox App is the recommended tool to install JetBrains products. Use it to install and manage different products or several versions of the same product, including Early Access Program (EAP) and Nightly releases, update and roll back when necessary, and remove any tool.
🌐
Ovaledge
support.ovaledge.com › java-upgrade-on-windows
Upgrading Java on Windows
Download the installer for Windows. ... In the Downloads folder, double-click the installer file. Follow the wizard instructions, clicking Next at each step, to complete the installation. Review the End User License Agreement, select the checkbox to accept the terms and conditions, and click ...
🌐
Minecraft.net
help.minecraft.net › hc › en-us › articles › 360034754852-Change-Game-Version-for-Minecraft-Java-Edition
Change Game Versions for Minecraft: Java Edition
Skip to main content · Back to homepage · Follow Minecraft · English (United States) · Español · Español de Mexico · Português Brasileiro · Indonesian · Consumer Health Privacy
🌐
Baeldung
baeldung.com › home › java › set java_home variable in windows, mac os x, and linux
Set JAVA_HOME on Windows 7, 8, 10, Mac OS X, Linux | Baeldung
March 26, 2025 - Set JAVA_HOME as the Variable name, and the path to the JDK installation as the Variable value, and then click OK. Click OK and then Apply to apply the changes.