2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ezzaral
0

"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:

  • java.specification.version i.e. 1.1
  • java.specification.name i.e. Java™ Language Specification
  • java.specification.vendor i.e. Sun Microsystems Inc.

These properties are accessed using the method java.lang.System.getProperty and return their values as strings.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.