Pin It

How to know on which Java Version our current Java application is running ?.

Program to demonstrate how to know on which Java Version our current Java application is running.

package com.hubberspot.java.version;

public class JavaVersion {

	public static void main(String[] args) {
		
		// In order to know which version of java 
		// is been used by your current application
		// we can get the version of Java by 
		// using getProperty() method of the 
		// java.lang.System class and passing
		// the property name as "java.version"
		String javaVersion = System.getProperty("java.version");
		
		// Printing out the Java version on the console
		System.out.println("Java Version : " + javaVersion);

	}

}


Output of the program :


Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Related Posts Plugin for WordPress, Blogger...

Post your related queries below ...

comments powered by Disqus
Powered by Blogger.
 
© 2012 Learn Java by Examples Template by Hubber Spot