How to find the JVM version from a program

March 22, 2020 | No comments

Get JVM version from a program

Sometimes we want to know the Java environment details in which current program is executing. System class provides access to externally defined properties and environment variables. Following section will show how we get the Java details using System Class.

Knowing Java version

JavaVersion.java
Following code prints the java version in which the program is executing.
System.out.println(System.getProperty("java.version"));
Other System Properties
  • java.specification.version
  • java.runtime.version
  • java.vm.vendor
  • java.runtime.name
  • java.vendor.url
  • java.vm.name
  • java.vm.specification.version
  • java.version
  • java.specification.vendor
  • java.vm.specification.name

Reference

No comments :

Post a Comment

Please leave your message queries or suggetions.