Java RuntimeMXBean class

Description

Java RuntimeMXBean class

import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.management.RuntimeMXBean;
import java.util.List;

public class Main {

   public static void main(String[] args) {
      RuntimeMXBean mxBean = ManagementFactory.getPlatformMXBean(RuntimeMXBean.class);

      System.out.println("JVM Name: " + mxBean.getName());
      System.out.println("JVM Specification Name: " + mxBean.getSpecName());
      System.out.println("JVM Specification Version: " + mxBean.getSpecVersion());
      System.out.println("JVM Implemenation Name: " + mxBean.getVmName());
      System.out.println("JVM Implemenation Vendor: " + mxBean.getVmVendor());
      System.out.println("JVM Implemenation Version: " + mxBean.getVmVersion());


   }//  www .j  av  a  2 s  . c  o  m

}



PreviousNext

Related