Switch JDK Version Linux Guide
Switching JDK versions on Linux can be done through the following steps:
- To begin, use the following command to check the installed Java version in the system:
java -version
- If there are multiple JDK versions installed in the system, you can use the following command to view the installed JDK paths:
update-alternatives --config java
- Based on the output of the above command, select the JDK version number to switch to and make a note of it.
- Switch the JDK version with the following command:
sudo update-alternatives --config java
- A list will appear shortly, showing the available JDK versions. Input the number of the JDK version you want to switch to, and press Enter.
- Use the following command to verify if the JDK version has been successfully switched:
java -version
By following the steps above, you can switch JDK versions on Linux.