How to check whether java is installed on the computer

Sandeep Sehrawat picture Sandeep Sehrawat · Sep 19, 2013 · Viewed 226.7k times · Source

I am trying to install java windows application on client machine.I want to check whether requried JRE is installed on the machine or not. I want to check it by java program not by cmd command

Answer

SpringLearner picture SpringLearner · Sep 19, 2013

if you are using windows or linux operating system then type in command prompt / terminal

java -version

If java is correctly installed then you will get something like this

java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode, sharing)

Side note: After installation of Java on a windows operating system, the PATH variable is changed to add java.exe so you need to re-open cmd.exe to reload the PATH variable.

Edit:

CD to the path first...

cd C:\ProgramData\Oracle\Java\javapath
java -version