Java Code Examples for java.lang.management.RuntimeMXBean#getVmName()

The following examples show how to use java.lang.management.RuntimeMXBean#getVmName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PitError.java    From pitest with Apache License 2.0 6 votes vote down vote up
private static String info() {
  final RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();

  return "\n\nPlease copy and paste the information and the complete stacktrace below when reporting an issue\n"
  + "VM : "
  + rt.getVmName()
  + "\n"
  + "Vendor : "
  + rt.getVmVendor()
  + "\n"
  + "Version : "
  + rt.getVmVersion()
  + "\n"
  + "Uptime : "
  + rt.getUptime()
  + "\n"
  + "Input -> "
  + createInputString(rt.getInputArguments())
  + "\n"
  + "BootClassPathSupported : " + rt.isBootClassPathSupported() + "\n";

}
 
Example 2
Source File: EnvironmentInformation.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the version of the JVM in the form "VM_Name - Vendor  - Spec/Version".
 *
 * @return The JVM version.
 */
public static String getJvmVersion() {
	try {
		final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
		return bean.getVmName() + " - " + bean.getVmVendor() + " - " + bean.getSpecVersion() + '/' + bean.getVmVersion();
	}
	catch (Throwable t) {
		return UNKNOWN;
	}
}
 
Example 3
Source File: EnvironmentInformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the version of the JVM in the form "VM_Name - Vendor  - Spec/Version".
 *
 * @return The JVM version.
 */
public static String getJvmVersion() {
	try {
		final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
		return bean.getVmName() + " - " + bean.getVmVendor() + " - " + bean.getSpecVersion() + '/' + bean.getVmVersion();
	}
	catch (Throwable t) {
		return UNKNOWN;
	}
}
 
Example 4
Source File: EnvironmentInformation.java    From Mycat2 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Gets the version of the JVM in the form "VM_Name - Vendor  - Spec/Version".
 *
 * @return The JVM version.
 */
public static String getJvmVersion() {
	try {
		final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
		return bean.getVmName() + " - " + bean.getVmVendor() + " - " + bean.getSpecVersion() + '/' + bean.getVmVersion();
	}
	catch (Throwable t) {
		return UNKNOWN;
	}
}
 
Example 5
Source File: MBeanDumper.java    From tda with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void setDumpPrefix() {
    try {
        RuntimeMXBean rmbean = (RuntimeMXBean) ManagementFactory.newPlatformMXBeanProxy(server,
                                        ManagementFactory.RUNTIME_MXBEAN_NAME,
                                        RuntimeMXBean.class);
        dumpPrefix += rmbean.getVmName() + " " + rmbean.getVmVersion() + "\n";
        javaVersion = rmbean.getVmVersion();
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}
 
Example 6
Source File: EnvironmentInformation.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the version of the JVM in the form "VM_Name - Vendor  - Spec/Version".
 *
 * @return The JVM version.
 */
public static String getJvmVersion() {
	try {
		final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
		return bean.getVmName() + " - " + bean.getVmVendor() + " - " + bean.getSpecVersion() + '/' + bean.getVmVersion();
	}
	catch (Throwable t) {
		return UNKNOWN;
	}
}