Class JavaVersion


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

      • getMajorJavaVersion

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

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