Class PlatformDescription


  • public final class PlatformDescription
    extends Object
    List of constants describing the currently used platform.
    Author:
    Henri Tremblay
    • Field Detail

      • SPECIFICATION_VERSION

        public static final String SPECIFICATION_VERSION
        Java specification version
      • VM_VERSION

        public static final String VM_VERSION
        JVM version
      • VM_INFO

        public static final String VM_INFO
        JVM version
      • VENDOR_VERSION

        public static final String VENDOR_VERSION
        VM vendor version
      • VENDOR

        public static final String VENDOR
        VM vendor name
      • JVM_NAME

        public static final String JVM_NAME
        JVM name
      • ANDROID_VERSION

        public static final int ANDROID_VERSION
        Android version. Will be 0 for none android platform
      • IS_ANDROID_OPENJDK

        public static final boolean IS_ANDROID_OPENJDK
        Flag telling if this version of Android is based on the OpenJDK
      • GAE_VERSION

        public static final String GAE_VERSION
        Google App Engine version or null is we are not on GAE
    • Method Detail

      • describePlatform

        public static String describePlatform()
        Describes the platform. Outputs Java version and vendor.
        Returns:
        Description of the current platform
      • isThisJVM

        public static boolean isThisJVM​(String name)
        Check if the current JVM is of the type passed in parameter. Normally, this will be a constant from this class. We basically do System.getProperty("java.vm.name").startWith(name).
        Parameters:
        name - jvm name we are looking for
        Returns:
        if it's the requested JVM
      • isAndroidOpenJDK

        public static boolean isAndroidOpenJDK()
        Check if this JVM is an Android JVM based on OpenJDK.
        Returns:
        if it's an Android version based on the OpenJDK. Will return false if this JVM isn't an Android JVM at all
      • isAfterJigsaw

        public static boolean isAfterJigsaw()
        Tells if the current JVM is running Java 9 or above
        Returns:
        if the current JVM is Java 9 or above
      • isAfterJava11

        public static boolean isAfterJava11()
        Tells if the current JVM is running Java 11 or above
        Returns:
        if the current JVM is Java 11 or above
      • isGoogleAppEngine

        public static boolean isGoogleAppEngine()