Interface RuntimeMXBean

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      String getBootClassPath()
      If bootstrap class loading is supported by the virtual machine, returns a string containing the full bootstrap class path used by the boot class loader to locate and load class files.
      String getClassPath()
      Returns the class path string used by the system class loader to locate and load class files.
      List<String> getInputArguments()
      Returns a list of all of the input arguments passed to the virtual machine on start-up.
      String getLibraryPath()
      Returns the Java library path that will be used by the virtual machine to locate and load libraries.
      String getManagementSpecVersion()
      Returns a string containing the management interface specification version that the virtual machine meets.
      String getName()
      Returns the string name of this virtual machine.
      default long getPid()
      Returns the process ID (PID) of the current running Java virtual machine.
      String getSpecName()
      Returns the name of the Java virtual machine specification followed by this virtual machine.
      String getSpecVendor()
      Returns the name of the Java virtual machine specification vendor.
      String getSpecVersion()
      Returns the name of the Java virtual machine specification version.
      long getStartTime()
      Returns the time, in milliseconds, when the virtual machine was started.
      Map<String,​String> getSystemProperties()
      Returns a map of the names and values of every system property known to the virtual machine.
      long getUptime()
      Returns the lifetime of the virtual machine in milliseconds.
      String getVmName()
      Returns the name of the Java virtual machine implementation.
      String getVmVendor()
      Returns the name of the Java virtual machine implementation vendor.
      String getVmVersion()
      Returns the version of the Java virtual machine implementation.
      boolean isBootClassPathSupported()
      Returns a boolean indication of whether or not the virtual machine supports a bootstrap class loading mechanism.
    • Method Detail

      • getBootClassPath

        String getBootClassPath()
        If bootstrap class loading is supported by the virtual machine, returns a string containing the full bootstrap class path used by the boot class loader to locate and load class files.

        An indication of whether or not the virtual machine supports a boot class loader mechanism can be found from invoking the isBootClassPathSupported() method.

        Returns:
        the bootstrap classpath with each entry separated by the path separator character corresponding to the underlying operating system.
        Throws:
        UnsupportedOperationException - if the virtual machine does not support boot class loading.
        SecurityException - if there is a security manager in effect and the caller does not have ManagementPermission of "monitor".
      • getClassPath

        String getClassPath()
        Returns the class path string used by the system class loader to locate and load class files. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.class.path" for the key.
        Returns:
        the system classpath with each entry separated by the path separator character corresponding to the underlying operating system.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getInputArguments

        List<String> getInputArguments()
        Returns a list of all of the input arguments passed to the virtual machine on start-up. This will not include any input arguments that are passed into the application's main(String[] args) method.
        Returns:
        a list of strings, each one containing an argument to the virtual machine. If no virtual machine arguments were passed in at start-up time then this will be an empty list.
      • getLibraryPath

        String getLibraryPath()
        Returns the Java library path that will be used by the virtual machine to locate and load libraries. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.library.path" for the key.
        Returns:
        the Java library path with each entry separated by the path separator character corresponding to the underlying operating system.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getManagementSpecVersion

        String getManagementSpecVersion()
        Returns a string containing the management interface specification version that the virtual machine meets.
        Returns:
        the version of the management interface specification adhered to by the virtual machine.
      • getName

        String getName()
        Returns the string name of this virtual machine. This value may be different for each particular running virtual machine.
        Returns:
        the name of this running virtual machine.
      • getPid

        default long getPid()
        Returns the process ID (PID) of the current running Java virtual machine.
        Returns:
        the process ID of the current running JVM
        Since:
        10
      • getSpecName

        String getSpecName()
        Returns the name of the Java virtual machine specification followed by this virtual machine. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.vm.specification.name" for the key.
        Returns:
        the name of the Java virtual machine specification.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getSpecVendor

        String getSpecVendor()
        Returns the name of the Java virtual machine specification vendor. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.vm.specification.vendor" for the key.
        Returns:
        the name of the Java virtual machine specification vendor.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getSpecVersion

        String getSpecVersion()
        Returns the name of the Java virtual machine specification version. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.vm.specification.version" for the key.
        Returns:
        the Java virtual machine specification version.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getStartTime

        long getStartTime()
        Returns the time, in milliseconds, when the virtual machine was started.
        Returns:
        the virtual machine start time in milliseconds.
      • getSystemProperties

        Map<String,​String> getSystemProperties()
        Returns a map of the names and values of every system property known to the virtual machine.
        Returns:
        a map containing the names and values of every system property.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
      • getUptime

        long getUptime()
        Returns the lifetime of the virtual machine in milliseconds.
        Returns:
        the number of milliseconds the virtual machine has been running.
      • getVmName

        String getVmName()
        Returns the name of the Java virtual machine implementation. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.vm.name" for the key.
        Returns:
        the name of the Java virtual machine implementation.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getVmVendor

        String getVmVendor()
        Returns the name of the Java virtual machine implementation vendor. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.vm.vendor" for the key.
        Returns:
        the name of the Java virtual machine implementation vendor.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • getVmVersion

        String getVmVersion()
        Returns the version of the Java virtual machine implementation. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "java.vm.version" for the key.
        Returns:
        the version of the Java virtual machine implementation.
        Throws:
        SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
        See Also:
        System.getProperty(java.lang.String)
      • isBootClassPathSupported

        boolean isBootClassPathSupported()
        Returns a boolean indication of whether or not the virtual machine supports a bootstrap class loading mechanism.
        Returns:
        true if supported, false otherwise.