How to Check Java Version in Linux Mint 21


Java is one of the most widely used programming languages in the modern technological world. You can create Java scripts on almost any operating system of your choice and can automate your routine tasks very conveniently. However, before you can begin with writing Java scripts on your Linux system, you first need to ensure whether Java is installed on your system or not. For that, the most effective way is to check its version installed. Therefore, in this article, we will share with you the two different methods of checking the Java version on a Linux Mint 21 system.

Methods of Checking the Java Version in Linux Mint 21:

You can check the version of Java installed on your Linux Mint 21 system by using any of the following two methods:

Method # 1: Using the “javac” Command:

The first method for checking the version of Java installed on Linux Mint 21 makes use of the command shown below:

$ javac –version

The version of Java that is installed on our Linux Mint 21 system can be seen in the following image:

How-Check-Java-Version

Method # 2: Using the “apt list” Command:

Alternatively, you can also check the Java version by searching through the list of all the installed packages on your Linux Mint 21 system in the manner shown below:

$ sudo apt list --installed | grep –i openjdk

The Java version installed on our Linux Mint 21 system is shown in the image that follows:

How-Check-Java-Version

Conclusion:

This article shared the two methods of checking the version of Java installed on a Linux Mint 21 system. You can use any of these methods very easily and can get started with the Java programming language to write amazing code and scripts.

Print Friendly, PDF & Email
Categories