To find the version of the JDK (Java Development Kit) installed on an Ubuntu Linux system, you can use the java
command.
For example, to view the version of the JDK that is currently set as the default on the system, you can use the following command:
java -versionSouecr:www.lautturi.com
This will display the version of the JDK that is currently set as the default on the system.
You can also use the update-java-alternatives
command to view the available JDK versions on the system and set a different version as the default. For example, to view the available JDK versions on the system, you can use the following command:
update-java-alternatives --list
This will display a list of the available JDK versions on the system. To set a different JDK version as the default, you can use the update-java-alternatives
command with the --set
option, followed by the path to the JDK executable. For example, to set the JDK version located at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
as the default, you can use the following command:
sudo update-java-alternatives --set /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
This will set the specified JDK version as the default on the system.
Keep in mind that the above steps assume that the JDK is installed on the system. If the JDK is not installed, you will need to install it before you can use the java
and update-java-alternatives
commands.
For more information on the java
and update-java-alternatives
commands, you can refer to the Ubuntu documentation or the man pages for these utilities.