Free Data Structures and Algorithms Course









Subscribe below and get all best seller courses for free !!!










OR



Subscribe to all free courses

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 :


 
© 2021 Learn Java by Examples Template by Hubberspot