How to Check Java version

Mohammad Irfan Feb 02, 2024
  1. Check Installed JDK Version in Windows
  2. Check Installed JDK Version in Linux/Ubuntu
How to Check Java version

Java is a programming language that is used to create software applications. To check the installed Java version in your local system, you can use some commands that display results to the console. We will check the version in both Linux and Windows. Let’s understand with examples.

Check Installed JDK Version in Windows

To check the installed Java version in Windows, use the below command to the command prompt.

javac - version

Output:

Check Installed JDK Version in Windows

And to check the JRE(Java Runtime Environment) version in Windows, use the below command.

java - version

check installed jre version in windows

Check Installed JDK Version in Linux/Ubuntu

$ javac - version

Output:

javac 11.0.13

And the screenshot is:

Check Installed JDK Version in Linux/Ubuntu

And to check the JRE(Java Runtime Environment) version in Windows, use the below command.

$ java - version

Output:

openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

check installed jre version in linux

The JDK version’s output depends on the JDK version installed in your local system. But the commands are the same for both Ubuntu and Windows.

Related Article - Java Version