In this tutorial, we will look at how to check which version of Java is installed on the system more specifically which version of Java software development kit that is JSDK and Java runtime environment that is JRE is installed.
I am going to open up a command prompt by clicking Windows Start button on the bottom left corner of the screen and then type “cmd” in the search box, as you can see command prompt is open on my screen, on the command prompt type “javac” space hyphen (-) version, you can see the version of JSDK is displayed, similarly, you can type “java” space hyphen version, you can see how the version of JRE is displayed.
The video below outlines the steps to check which version of Java is running in your Windows 7 or XP computer.
Checking Java Version in Windows XP or 7
Setting Path and Classpath for Java in Windows 7
This is the quick and easy way to check which version is installed on your system, you need to make sure that both the version of JSDK and JRE are same, for your programs to compile and execute.
On some systems, when you type javac – version or java –version, you will see that javac is not recognized as an internal or external command. This is because of the reason that either Java is not installed on your system or Java is installed but the path is not set at all or the path is incorrectly set.