Class JavaVersion


  • public final class JavaVersion
    extends java.lang.Object
    Utility to check the major Java version of the current JVM.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getMajorJavaVersion()
      Gets the major Java version
      static boolean isJava9OrLater()
      Gets a boolean value depending if the application is running on Java 9 or later
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMajorJavaVersion

        public static int getMajorJavaVersion()
        Gets the major Java version
        Returns:
        the major Java version, i.e. '8' for Java 1.8, '9' for Java 9 etc.
      • isJava9OrLater

        public static boolean isJava9OrLater()
        Gets a boolean value depending if the application is running on Java 9 or later
        Returns:
        true if the application is running on Java 9 or later; and false otherwise.