Class JavaVersion


  • public final class JavaVersion
    extends java.lang.Object
    Helper to extract the runtime Java version from the System.properties.
    Since:
    2.4
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String JAVA_VERSION_PROPERTY  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaVersion()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getJavaMajorVersion()
      Retrieves the major java runtime version as an integer.
      static boolean isJdk8OrLower()
      Checks if the runtime java version is JDK 8 or lower.
      • Methods inherited from class java.lang.Object

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

      • JAVA_VERSION_PROPERTY

        private static final java.lang.String JAVA_VERSION_PROPERTY
        See Also:
        Constant Field Values
    • Constructor Detail

      • JavaVersion

        public JavaVersion()
    • Method Detail

      • getJavaMajorVersion

        public static int getJavaMajorVersion()
        Retrieves the major java runtime version as an integer.
        Returns:
        the major java runtime version as an integer.
      • isJdk8OrLower

        public static boolean isJdk8OrLower()
        Checks if the runtime java version is JDK 8 or lower.
        Returns:
        true if the runtime java version is JDK 8 or lower.