Class Constants


  • public final class Constants
    extends java.lang.Object
    Some useful constants.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean FREE_BSD
      True iff running on FreeBSD
      static boolean HAS_FAST_SCALAR_FMA
      true iff we know FMA has faster throughput than separate mul/add.
      static boolean HAS_FAST_VECTOR_FMA
      true iff we know VFMA has faster throughput than separate vmul/vadd.
      private static boolean HAS_FMA
      true if FMA likely means a cpu instruction and not BigDecimal logic.
      private static boolean HAS_SSE4A
      true for an AMD cpu with SSE4a instructions.
      static boolean IS_CLIENT_VM
      True iff the Java runtime is a client runtime and C2 compiler is not enabled.
      static boolean IS_HOTSPOT_VM
      True iff the Java VM is based on Hotspot and has the Hotspot MX bean readable by Lucene.
      static boolean IS_JVMCI_VM
      True if jvmci is enabled (e.g.
      static java.lang.String JAVA_VENDOR
      The value of System.getProperty("java.vendor").
      static java.lang.String JAVA_VERSION
      Deprecated.
      To detect Java versions use Runtime.version()
      static boolean JRE_IS_64BIT
      True iff running on a 64bit JVM
      static boolean JRE_IS_MINIMUM_JAVA11
      Deprecated.
      This constant is useless and always true.
      static boolean JRE_IS_MINIMUM_JAVA8
      Deprecated.
      This constant is useless and always true.
      static boolean JRE_IS_MINIMUM_JAVA9
      Deprecated.
      This constant is useless and always true.
      static java.lang.String JVM_NAME
      JVM vendor name.
      static java.lang.String JVM_SPEC_VERSION
      Deprecated.
      To detect Java versions use Runtime.version()
      static java.lang.String JVM_VENDOR
      JVM vendor info.
      static java.lang.String JVM_VERSION
      Deprecated.
      To detect Java versions use Runtime.version()
      static boolean LINUX
      True iff running on Linux.
      static boolean MAC_OS_X
      True iff running on Mac OS X
      private static int MAX_VECTOR_SIZE
      maximum supported vectorsize.
      static java.lang.String OS_ARCH
      The value of System.getProperty("os.arch").
      static java.lang.String OS_NAME
      The value of System.getProperty("os.name").
      static java.lang.String OS_VERSION
      The value of System.getProperty("os.version").
      static boolean SUN_OS
      True iff running on SunOS.
      private static java.lang.String UNKNOWN  
      static boolean WINDOWS
      True iff running on Windows.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Constants()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static <T> T doPrivileged​(java.security.PrivilegedAction<T> action)  
      private static java.lang.String getSysProp​(java.lang.String property)  
      private static java.lang.String getSysProp​(java.lang.String property, java.lang.String def)  
      private static boolean hasFastScalarFMA()  
      private static boolean hasFastVectorFMA()  
      private static boolean is64Bit()  
      private static void logSecurityWarning​(java.lang.String property)  
      • Methods inherited from class java.lang.Object

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

      • JVM_VENDOR

        public static final java.lang.String JVM_VENDOR
        JVM vendor info.
      • JVM_NAME

        public static final java.lang.String JVM_NAME
        JVM vendor name.
      • JVM_VERSION

        @Deprecated
        public static final java.lang.String JVM_VERSION
        Deprecated.
        To detect Java versions use Runtime.version()
        Get the full version string of the current runtime.
      • JVM_SPEC_VERSION

        @Deprecated
        public static final java.lang.String JVM_SPEC_VERSION
        Deprecated.
        To detect Java versions use Runtime.version()
        Gets the specification version of the current runtime. This is the feature version converted to String.
        See Also:
        Runtime.Version.feature()
      • JAVA_VERSION

        @Deprecated
        public static final java.lang.String JAVA_VERSION
        Deprecated.
        To detect Java versions use Runtime.version()
        The value of System.getProperty("java.version").
      • OS_NAME

        public static final java.lang.String OS_NAME
        The value of System.getProperty("os.name"). *
      • LINUX

        public static final boolean LINUX
        True iff running on Linux.
      • WINDOWS

        public static final boolean WINDOWS
        True iff running on Windows.
      • SUN_OS

        public static final boolean SUN_OS
        True iff running on SunOS.
      • MAC_OS_X

        public static final boolean MAC_OS_X
        True iff running on Mac OS X
      • FREE_BSD

        public static final boolean FREE_BSD
        True iff running on FreeBSD
      • OS_ARCH

        public static final java.lang.String OS_ARCH
        The value of System.getProperty("os.arch").
      • OS_VERSION

        public static final java.lang.String OS_VERSION
        The value of System.getProperty("os.version").
      • JAVA_VENDOR

        public static final java.lang.String JAVA_VENDOR
        The value of System.getProperty("java.vendor").
      • IS_CLIENT_VM

        public static final boolean IS_CLIENT_VM
        True iff the Java runtime is a client runtime and C2 compiler is not enabled.
      • IS_HOTSPOT_VM

        public static final boolean IS_HOTSPOT_VM
        True iff the Java VM is based on Hotspot and has the Hotspot MX bean readable by Lucene.
      • IS_JVMCI_VM

        public static final boolean IS_JVMCI_VM
        True if jvmci is enabled (e.g. graalvm)
      • JRE_IS_64BIT

        public static final boolean JRE_IS_64BIT
        True iff running on a 64bit JVM
      • HAS_FMA

        private static final boolean HAS_FMA
        true if FMA likely means a cpu instruction and not BigDecimal logic.
      • MAX_VECTOR_SIZE

        private static final int MAX_VECTOR_SIZE
        maximum supported vectorsize.
      • HAS_SSE4A

        private static final boolean HAS_SSE4A
        true for an AMD cpu with SSE4a instructions.
      • HAS_FAST_VECTOR_FMA

        public static final boolean HAS_FAST_VECTOR_FMA
        true iff we know VFMA has faster throughput than separate vmul/vadd.
      • HAS_FAST_SCALAR_FMA

        public static final boolean HAS_FAST_SCALAR_FMA
        true iff we know FMA has faster throughput than separate mul/add.
      • JRE_IS_MINIMUM_JAVA8

        @Deprecated
        public static final boolean JRE_IS_MINIMUM_JAVA8
        Deprecated.
        This constant is useless and always true. To detect Java versions use Runtime.version()
        Always true.
        See Also:
        Constant Field Values
      • JRE_IS_MINIMUM_JAVA9

        @Deprecated
        public static final boolean JRE_IS_MINIMUM_JAVA9
        Deprecated.
        This constant is useless and always true. To detect Java versions use Runtime.version()
        Always true.
        See Also:
        Constant Field Values
      • JRE_IS_MINIMUM_JAVA11

        @Deprecated
        public static final boolean JRE_IS_MINIMUM_JAVA11
        Deprecated.
        This constant is useless and always true. To detect Java versions use Runtime.version()
        Always true.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Constants

        private Constants()
    • Method Detail

      • is64Bit

        private static boolean is64Bit()
      • hasFastVectorFMA

        private static boolean hasFastVectorFMA()
      • hasFastScalarFMA

        private static boolean hasFastScalarFMA()
      • getSysProp

        private static java.lang.String getSysProp​(java.lang.String property)
      • getSysProp

        private static java.lang.String getSysProp​(java.lang.String property,
                                                   java.lang.String def)
      • logSecurityWarning

        private static void logSecurityWarning​(java.lang.String property)
      • doPrivileged

        private static <T> T doPrivileged​(java.security.PrivilegedAction<T> action)