Java - Get Java Runtime Version using System Class in Java.
In this code snippet we will learn how to get Java Runtime Version Name using System class in Java. Java provided System class, by using getProperty() method of System class with "java.runtime.version" parameter we can access the Java Runtime Version Name.
Java Code Snippet - Get Java Runtime Version Name using System Class
//Java - Get Java Runtime Version using System Class in Java.
public class GetJavaRuntimeVersionName{
public static void main(String args[]){
String javaRuntimeVersion="";
javaRuntimeVersion=System.getProperty("java.runtime.version");
System.out.println("Current Java Runtime Version is: " + javaRuntimeVersion);
}
}
Current Java Runtime Version is: 1.8.0_66-b18