Get system start time from RuntimeMXBean : RuntimeMXBean « Development « Java Tutorial






import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;

public class Main {
  public static void main(String args[]) throws Exception {
    RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
    System.out.println(new Date(mx.getStartTime()));
  }
}








6.8.RuntimeMXBean
6.8.1.Get the system properties from RuntimeMXBean
6.8.2.Get the JVM uptime from RuntimeMXBean
6.8.3.Get ClassPath from RuntimeMXBean
6.8.4.Get Boot path from RuntimeMXBean
6.8.5.Get system start time from RuntimeMXBean