Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures

Home

Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips

Books

Submit News
Search the site here...
Search...
 
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

Question: How do I find out how long the JVM has been running?

JavaFAQ Home » General Java Go to all tips in General Java


Bookmark and Share

Answer:  A Java virtual machine has a single instance of the implementation class of this interface. This instance implementing this interface is an MXBean (java.lang.management package) 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

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

* getBootClassPath()
    Returns the boot class path that is used by the bootstrap class loader to search for class files.
* getClassPath()
    Returns the Java class path that is used by the system class loader to search for class files.
* getInputArguments()
    Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method.
* getLibraryPath()
    Returns the Java library path.
* getManagementSpecVersion()
    Returns the version of the specification for the management interface implemented by the running Java virtual machine.
* getName()
    Returns the name representing the running Java virtual machine.
* getSpecName()
    Returns the Java virtual machine specification name.
* getSpecVendor()
    Returns the Java virtual machine specification vendor.
* getSpecVersion()
    Returns the Java virtual machine specification version.
* getStartTime()
    Returns the start time of the Java virtual machine in milliseconds.
* getSystemProperties()
    Returns a map of names and values of all system properties.
* getUptime()
    Returns the uptime of the Java virtual machine in milliseconds.
* getVmName()
    Returns the Java virtual machine implementation name.
* getVmVendor()
    Returns the Java virtual machine implementation vendor.
* getVmVersion()
    Returns the Java virtual machine implementation version.
* isBootClassPathSupported()
    Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.

This tip is based on Java API(1.5)



 


 Printer Friendly Page  Printer Friendly Page
 Send to a Friend  Send to a Friend

.. Bookmark and Share

Search here again if you need more info!
Custom Search



Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

RSS feed Java FAQ RSS feed Java FAQ News     

    RSS feed Java Forums RSS feed Java Forums

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

Interactive software released under GNU GPL, Code Credits, Privacy Policy