APIdia Launch Partner
Top Description Methods
java.lang.management

public Interface RuntimeMXBean

extends PlatformManagedObject
Known Direct Implementers
sun.management.RuntimeImpl

The management interface for the runtime system of the Java virtual machine.

A Java virtual machine has a single instance of the implementation class of this interface. This instance implementing this interface is an MXBean that can be obtained by calling the ManagementFactory#getRuntimeMXBean method or from the platform MBeanServer method.

The ObjectName for uniquely identifying the MXBean for the runtime system within an MBeanServer is:

java.lang:type=Runtime
It can be obtained by calling the PlatformManagedObject#getObjectName method.

This interface defines several convenient methods for accessing system properties about the Java virtual machine.

Author
Mandy Chung
Since
1.5
See Also
ManagementFactory#getPlatformMXBeans(Class), JMX Specification., Ways to Access MXBeans

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the boot class path.
getBootClassPath
()

Returns the boot class path that is used by the bootstrap class loader to search for class files.

public String

Returns:

the Java class path.
getClassPath
()

Returns the Java class path that is used by the system class loader to search for class files.

public List<String>

Returns:

a list of String objects; each element is an argument passed to the Java virtual machine.
getInputArguments
()

Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method.

public String

Returns:

the Java library path.
getLibraryPath
()

Returns the Java library path.

public String

Returns:

the version of the specification for the management interface implemented by the running Java virtual machine.
getManagementSpecVersion
()

Returns the version of the specification for the management interface implemented by the running Java virtual machine.

public String

Returns:

the name representing the running Java virtual machine.
getName
()

Returns the name representing the running Java virtual machine.

public default long

Returns:

the process ID representing the running Java virtual machine.
getPid
()

Returns the process ID representing the running Java virtual machine.

public String

Returns:

the Java virtual machine specification name.
getSpecName
()

Returns the Java virtual machine specification name.

public String

Returns:

the Java virtual machine specification vendor.
getSpecVendor
()

Returns the Java virtual machine specification vendor.

public String

Returns:

the Java virtual machine specification version.
getSpecVersion
()

Returns the Java virtual machine specification version.

public long

Returns:

start time of the Java virtual machine in milliseconds.
getStartTime
()

Returns the start time of the Java virtual machine in milliseconds.

public Map<String, String>

Returns:

a map of names and values of all system properties.
getSystemProperties
()

Returns a map of names and values of all system properties.

public long

Returns:

uptime of the Java virtual machine in milliseconds.
getUptime
()

Returns the uptime of the Java virtual machine in milliseconds.

public String

Returns:

the Java virtual machine implementation name.
getVmName
()

Returns the Java virtual machine implementation name.

public String

Returns:

the Java virtual machine implementation vendor.
getVmVendor
()

Returns the Java virtual machine implementation vendor.

public String

Returns:

the Java virtual machine implementation version.
getVmVersion
()

Returns the Java virtual machine implementation version.

public boolean

Returns:

true if the Java virtual machine supports the class path mechanism; false otherwise.
isBootClassPathSupported
()

Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.

Inherited from java.lang.management.PlatformManagedObject:
getObjectName

Method Detail

getBootClassPathback to summary
public String getBootClassPath()

Returns the boot class path that is used by the bootstrap class loader to search for class files.

Multiple paths in the boot class path are separated by the path separator character of the platform on which the Java virtual machine is running.

A Java virtual machine implementation may not support the boot class path mechanism for the bootstrap class loader to search for class files. The isBootClassPathSupported method can be used to determine if the Java virtual machine supports this method.

Returns:String

the boot class path.

Exceptions
UnsupportedOperationException:
if the Java virtual machine does not support this operation.
getClassPathback to summary
public String getClassPath()

Returns the Java class path that is used by the system class loader to search for class files. This method is equivalent to System.getProperty("java.class.path").

Multiple paths in the Java class path are separated by the path separator character of the platform of the Java virtual machine being monitored.

Returns:String

the Java class path.

See Also
java.lang.System#getProperty
getInputArgumentsback to summary
public List<String> getInputArguments()

Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method. This method returns an empty list if there is no input argument to the Java virtual machine.

Some Java virtual machine implementations may take input arguments from multiple different sources: for examples, arguments passed from the application that launches the Java virtual machine such as the 'java' command, environment variables, configuration files, etc.

Typically, not all command-line options to the 'java' command are passed to the Java virtual machine. Thus, the returned input arguments may not include all command-line options.

MBeanServer access:
The mapped type of List<String> is String[].

Returns:List<String>

a list of String objects; each element is an argument passed to the Java virtual machine.

getLibraryPathback to summary
public String getLibraryPath()

Returns the Java library path. This method is equivalent to System.getProperty("java.library.path").

Multiple paths in the Java library path are separated by the path separator character of the platform of the Java virtual machine being monitored.

Returns:String

the Java library path.

See Also
java.lang.System#getProperty
getManagementSpecVersionback to summary
public String getManagementSpecVersion()

Returns the version of the specification for the management interface implemented by the running Java virtual machine.

Returns:String

the version of the specification for the management interface implemented by the running Java virtual machine.

getNameback to summary
public String getName()

Returns the name representing the running Java virtual machine. The returned name string can be any arbitrary string and a Java virtual machine implementation can choose to embed platform-specific useful information in the returned name string. Each running virtual machine could have a different name.

Returns:String

the name representing the running Java virtual machine.

getPidback to summary
public default long getPid()

Returns the process ID representing the running Java virtual machine.

Implementation Specification

The default implementation returns process ID of the current process.

Returns:long

the process ID representing the running Java virtual machine.

Annotations
@SuppressWarnings:removal
Since
10
getSpecNameback to summary
public String getSpecName()

Returns the Java virtual machine specification name. This method is equivalent to System.getProperty("java.vm.specification.name").

Returns:String

the Java virtual machine specification name.

See Also
java.lang.System#getProperty
getSpecVendorback to summary
public String getSpecVendor()

Returns the Java virtual machine specification vendor. This method is equivalent to System.getProperty("java.vm.specification.vendor").

Returns:String

the Java virtual machine specification vendor.

See Also
java.lang.System#getProperty
getSpecVersionback to summary
public String getSpecVersion()

Returns the Java virtual machine specification version. This method is equivalent to System.getProperty("java.vm.specification.version").

Returns:String

the Java virtual machine specification version.

See Also
java.lang.System#getProperty
getStartTimeback to summary
public long getStartTime()

Returns the start time of the Java virtual machine in milliseconds. This method returns the approximate time when the Java virtual machine started.

Returns:long

start time of the Java virtual machine in milliseconds.

getSystemPropertiesback to summary
public Map<String, String> getSystemProperties()

Returns a map of names and values of all system properties. This method calls System#getProperties to get all system properties. Properties whose name or value is not a String are omitted.

MBeanServer access:
The mapped type of Map<String,String> is TabularData with two items in each row as follows:

Name and Type for each item
Item Name Item Type
key String
value String
Returns:Map<String, String>

a map of names and values of all system properties.

getUptimeback to summary
public long getUptime()

Returns the uptime of the Java virtual machine in milliseconds.

Returns:long

uptime of the Java virtual machine in milliseconds.

getVmNameback to summary
public String getVmName()

Returns the Java virtual machine implementation name. This method is equivalent to System.getProperty("java.vm.name").

Returns:String

the Java virtual machine implementation name.

See Also
java.lang.System#getProperty
getVmVendorback to summary
public String getVmVendor()

Returns the Java virtual machine implementation vendor. This method is equivalent to System.getProperty("java.vm.vendor").

Returns:String

the Java virtual machine implementation vendor.

See Also
java.lang.System#getProperty
getVmVersionback to summary
public String getVmVersion()

Returns the Java virtual machine implementation version. This method is equivalent to System.getProperty("java.vm.version").

Returns:String

the Java virtual machine implementation version.

See Also
java.lang.System#getProperty
isBootClassPathSupportedback to summary
public boolean isBootClassPathSupported()

Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.

Returns:boolean

true if the Java virtual machine supports the class path mechanism; false otherwise.