Package 

Object Jvm

  • All Implemented Interfaces:

    
    public class Jvm
    
                        

    Object with utilities to gather information about the running JVM.

    TODO Add JVM exception handler to add information on known exceptions. I.e: Classpath handler not registered with information on how to fix it (call ClasspathHandler.registerHandler())

    • Constructor Detail

    • Method Detail

      • initialMemory

         final String initialMemory()

        Amount of memory in kilobytes that the JVM initially requests from the operating system.

      • uptime

         final String uptime()

        Uptime of the Java virtual machine in seconds.

      • systemSettingOrNull

         final <T extends Any> T systemSettingOrNull(KClass<T> type, String name)

        Retrieve a setting by name by looking in the JVM system properties first and in OS environment variables if not found.

        Parameters:
        type - Type of the requested parameter.
        name - Name of the searched parameter, can not be blank.
      • systemFlag

         final Boolean systemFlag(String name)

        Retrieve a flag (boolean parameter) by name by looking in the JVM system properties first and in OS environment variables if not found.

        Parameters:
        name - Name of the searched parameter, can not be blank.
      • getTimeZone

         final TimeZone getTimeZone()

        Default timezone. TODO Defining this lazily fails in macOS

      • getLocale

         final Locale getLocale()

        Default locale for this instance of the Java Virtual Machine.

      • getHostname

         final String getHostname()

        The hostname of the machine running this program.

      • getIp

         final String getIp()

        The IP address of the machine running this program.

      • getId

         final String getId()

        ID representing the running Java virtual machine

      • getName

         final String getName()

        Name of the JVM running this program. For example: OpenJDK 64-Bit Server VM.

      • getVersion

         final String getVersion()

        Java version aka language level. For example: 11

      • getCpuCount

         final Integer getCpuCount()

        Number of processors available to the Java virtual machine.

      • getTimezone

         final String getTimezone()

        User Time Zone property. Can be set with -Duser.timezone JVM argument.

      • getLocaleCode

         final String getLocaleCode()

        User locale consist of 2-letter language code, 2-letter country code and file encoding.