- How to Change Java Version on Windows 10 — A Step-by-Step Guide
- Set the Environment Variable JAVA_HOME
- Add the Desired Java Version and Disable the Current Version in Java
- How to switch between the multiple Java versions(JDK) in windows 10
- Access the Control Panel and Click on System under Advanced to Change the Current Version of Java
- Go to the Java Control Panel and Click on the Java Tab to Update the Java Runtime Settings
- Use the Search Bar in Windows to Find and Select Configure Java to Access the Java Control Panel
- Use Environment Variables to Switch Between Multiple Java Versions in Windows 10
- Uninstall the Current Version of Java Before Installing a New Version
- Modify the PATH Variable to Change the Default Java Version
- Other code samples for changing Java version on Windows 10 quickly
- Conclusion
- How to Change Java Runtime
- On Windows
- Linux
- Expert Q&A
- Tips
- You Might Also Like
How to Change Java Version on Windows 10 — A Step-by-Step Guide
Learn how to change Java version on Windows 10 with our comprehensive guide. Follow our step-by-step instructions to switch between multiple Java versions and improve performance.
- Set the Environment Variable JAVA_HOME
- Add the Desired Java Version and Disable the Current Version in Java
- How to switch between the multiple Java versions(JDK) in windows 10
- Access the Control Panel and Click on System under Advanced to Change the Current Version of Java
- Go to the Java Control Panel and Click on the Java Tab to Update the Java Runtime Settings
- Use the Search Bar in Windows to Find and Select Configure Java to Access the Java Control Panel
- Use Environment Variables to Switch Between Multiple Java Versions in Windows 10
- Uninstall the Current Version of Java Before Installing a New Version
- Modify the PATH Variable to Change the Default Java Version
- Other code samples for changing Java version on Windows 10 quickly
- Conclusion
- How do I change the default Java version in Windows 10?
- How do I change my version of Java?
- How to switch from Java 8 to Java 11?
- How do I change Java from 1.8 to 1.6 in Windows?
Java is a popular programming language used in various fields such as web development, database management, and scientific computing. However, it is crucial to keep Java updated and change its version to avoid security issues and improve performance. In this article, we will provide a step-by-step guide on how to change the java version on Windows 10.
Set the Environment Variable JAVA_HOME
The first step is to set the environment variable JAVA_HOME . This variable enables the system to locate the Java JDK installation directory. Here’s how to set it up:
- Open the Start menu and search for “Environment Variables.”
- Click on “ edit the system environment variables .”
- In the “System Properties” window, click on the “Environment Variables” button.
- In the “ Environment Variables” window , click on the “New” button under the “System Variables” section.
- In the “New System Variable” window, enter “JAVA_HOME” as the variable name.
- For the variable value, enter the path to the Java JDK installation directory. For example, “C:\Program Files\Java\jdk-14.0.1”.
- Click on “OK” to save the changes.
Setting the JAVA_HOME environment variable is essential for changing the Java version. It ensures that the system uses the correct version of Java.
Add the Desired Java Version and Disable the Current Version in Java
The next step is to install the desired Java version and disable the current version. Here’s how to do it:
- Download and install the desired Java version from the official website.
- Open the Start menu and search for “Configure Java.”
- Click on the “Configure Java” app to open the Java Control Panel .
- In the “ Java Control Panel” window , click on the “Java” tab.
- Click on the “View” button to see the installed versions of Java.
- Select the current version of Java and click on the “Disable” button.
- Click on “Yes” to confirm the action.
Disabling the current version of Java ensures that the system uses the newly installed version.
How to switch between the multiple Java versions(JDK) in windows 10
In this Video i am going to show how to switch or manage the multiple Java versions of jdk Duration: 2:19
Access the Control Panel and Click on System under Advanced to Change the Current Version of Java
To change the current version of Java, you can access the Control Panel and click on System under Advanced. Here’s how to do it:
- Open the Start menu and search for “Control Panel.”
- Click on “Control Panel” to open it.
- In the Control Panel window, click on “System and Security.”
- Click on “System.”
- Click on “Advanced System Settings” on the left-hand side of the window.
- In the “System Properties” window, click on the “Environment Variables” button.
- Under “System Variables,” scroll down and select “Path.”
- Click on “Edit.”
- In the “Edit Environment Variable” window, add the path of the desired Java version installation folder at the beginning of the line. For example, “C:\Program Files\Java\jdk-14.0.1\bin;%PATH%”.
- Click on “OK” to save the changes.
Changing the current version of Java through the Control Panel ensures that the system uses the desired Java version.
Go to the Java Control Panel and Click on the Java Tab to Update the Java Runtime Settings
To update the Java runtime settings , you can go to the Java Control Panel and click on the Java tab. Here’s how to do it:
- Open the Start menu and search for “Configure Java.”
- Click on the “Configure Java” app to open the Java Control Panel.
- In the “Java Control Panel” window, click on the “Java” tab.
- Click on the “View” button to see the installed versions of Java.
- Select the desired version of Java and click on the “Settings” button.
- In the “Java Runtime Environment Settings” window, you can configure the Java runtime settings such as memory allocation and security.
Updating the Java runtime settings through the Java Control Panel ensures that the system uses the desired Java version with the best performance.
Use the Search Bar in Windows to Find and Select Configure Java to Access the Java Control Panel
If you cannot find the Java Control Panel, you can use the search bar in Windows to access it. Here’s how to do it:
- Open the Start menu and type “Configure Java” in the search bar.
- Click on the “Configure Java” app to open the Java Control Panel.
- Follow the steps mentioned above to change the Java version and update the Java runtime settings.
Using the search bar in Windows to access the Java Control Panel is a quick and easy way to change the Java version.
Use Environment Variables to Switch Between Multiple Java Versions in Windows 10
You can use environment variables to switch between multiple java versions in Windows 10. Here’s how to do it:
- Open the Start menu and search for “Environment Variables.”
- Click on “Edit the system environment variables.”
- In the “System Properties” window, click on the “Environment Variables” button.
- Under “System Variables,” scroll down and select “Path.”
- Click on “Edit.”
- In the “Edit Environment Variable” window, add the paths of the Java versions installation folders separated by semicolons. For example, “C:\Program Files\Java\jdk-14.0.1\bin;C:\Program Files\Java\jdk-1.8.0_251\bin;%PATH%”.
- Click on “OK” to save the changes.
Using environment variables to switch between multiple Java versions provides flexibility and convenience.
Uninstall the Current Version of Java Before Installing a New Version
It is essential to uninstall the current version of Java before installing a new version to avoid conflicts and ensure proper installation. Here’s how to do it:
- Open the Start menu and search for “Control Panel.”
- Click on “Control Panel” to open it.
- In the Control Panel window, click on “Programs.”
- Click on “Programs and Features.”
- Scroll down and select the current version of Java.
- Click on “Uninstall.”
- Follow the instructions on the screen to complete the uninstallation process.
Uninstalling the current version of Java before installing a new version ensures a smooth installation and avoids conflicts.
Modify the PATH Variable to Change the Default Java Version
You can modify the PATH variable to change the default Java version. Here’s how to do it:
- Open the Start menu and search for “Environment Variables.”
- Click on “Edit the system environment variables.”
- In the “System Properties” window, click on the “Environment Variables” button.
- Under “System Variables,” scroll down and select “Path.”
- Click on “Edit.”
- In the “Edit Environment Variable” window, remove the path of the current version of Java installation folder from the line. For example, “C:\Program Files\Java\jdk-1.8.0_251\bin;%PATH%”.
- Add the path of the desired Java version installation folder at the beginning of the line. For example, “C:\Program Files\Java\jdk-14.0.1\bin;%PATH%”.
- Click on “OK” to save the changes.
Modifying the PATH variable changes the default Java version and ensures that the system uses the desired version.
Other code samples for changing Java version on Windows 10 quickly
In Java case in point, change java version code example
/usr/libexec/java_home -V export JAVA_HOME=`/usr/libexec/java_home -v 1.6.0_65-b14-462` //java 8
In C case in point, update java version windows 10 cmd code example
I am not sure how it can be done by cmd. But the other option is: 1. Go to "Control Panel" 2. Select "Programs" 3. Click on "Java" 4. Select the "Update" 5. Then click on "Update Now"
In Java , change java version code example
Matching Java Virtual Machines (3): 1.8.0_05, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home 1.6.0_65-b14-462, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
Conclusion
Changing the Java version on Windows 10 is crucial for better performance and security. In this article, we provided a step-by-step guide on how to change the Java version on Windows 10. We covered setting the environment variable JAVA_HOME , installing the desired Java version, disabling the current version, changing the current version through the Control Panel, updating the Java runtime settings, using the search bar to access the Java Control Panel, using environment variables to switch between multiple Java versions, uninstalling the current version before installing a new version, and modifying the PATH variable to change the default Java version. We also provided tips and tricks for troubleshooting Java version issues , following the best practices for managing multiple java versions , and helpful resources for further learning and support.
How to Change Java Runtime
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 9 people, some anonymous, worked to edit and improve it over time.
This article has been viewed 51,804 times.
Most of the time as java developer, one of the first thing you do to set up on you new computer is java environment. This is basically telling your cmd (windows) terminal (mac or Linux) where to find the java.
java / javac (the compiler) is all under your java installation directory.
We assume that you have successfully downloaded and installed the JDK or JRE. If you are a developer we suggest you to download the latest JDK (Java Developer Kit).
On Windows
Linux
- . .bash_profile or . .bashrc (note that you have a space) this tells your terminal to load the updated file in current terminal so you get the newly created java in your path
Expert Q&A
Tips
You Might Also Like
How to Set JAVA_HOME for JDK & JRE: A Step-by-Step Guide
Use Easy Windows CMD Commands to Check Your Java Version
How to Do Division in Java (Integer and Floating Point)
How to Compile and Run Java Programs Using Notepad++