"java -version" from the command line or System.getProperty("java.specification.version"); From the docs on this system property
The requirement to identify the Java Runtime is already partially met via the properties specified by the Java Language Specification, §20.18.7 using java.lang.System.getProperties.
java.version i.e. Solaris 1.2
java.vendor i.e. Sun Microsystems Inc.
Currently these identify the implementation of the Java runtime and the core classes that are available. These properties do not identify the Java Language Specification version that this JDK implements.
Additional properties are needed to identify the version of the Java Runtime Environment specification that this implementation adhere’s to. The properties are: