Class SystemInfo


  • public final class SystemInfo
    extends Object
    Provides utilities for accessing the information about the current system and process.
    • Method Detail

      • javaVersion

        public static int javaVersion()
        Returns the major version of the current Java Virtual Machine.
      • hostname

        public static String hostname()
        Returns the local hostname.
      • jettyAlpnOptionalOrAvailable

        public static boolean jettyAlpnOptionalOrAvailable()
        Whether the environment either supports ALPN natively or includes Jetty ALPN.
      • pid

        public static int pid()
        Returns the current process ID.
        Throws:
        IllegalStateException - if failed to retrieve the current process ID.
      • currentTimeMicros

        public static long currentTimeMicros()
        Returns the number of microseconds since the epoch (00:00:00, 01-Jan-1970, GMT). The precision of the returned value may vary depending on Java version. Currently, Java 9 or above is required for microsecond precision. System.currentTimeMillis() * 1000 is returned on Java 8.