Saturday, April 25, 2009

Determine Java Runtime Environment Version

A few days ago I was asked for a quick and easy way to determine what java runtime environment version was installed via the Unix command line. The requester was trying to determine possible compatibility issues for some recently purchased applications.  

Bear in mind that you may have multiple JRE environments installed on your box so consider the PATH value -- meaning you might have to specify an absolute path. e.g. /usr/some_java_version/bin/java

Here is the Unix one-liner syntax using default path

% java -version
java version "1.x.x_xx)

By the way, it is the same syntax for Windows.

C:\Users\mysysad> java -version
java version "1.x.0_xx"
Java(TM) SE Runtime Environment (build 1.x.0_xx-xxx)
Java HotSpot(TM) Client VM (build xx.3-bxx, mixed mode, sharing)

No comments: