标签:orm str tor 进程 cep [] ssi ssid ret
package us.mine.demo.jvm.util; import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; public class GetPID { public static void main(String[] args){ System.out.println(getPid()); } public static int getPid() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); // format: "pid@hostname" try { return Integer.parseInt(name.substring(0, name.indexOf(‘@‘))); } catch (Exception e) { return -1; } } }
标签:orm str tor 进程 cep [] ssi ssid ret
原文地址:http://www.cnblogs.com/guazi/p/6429995.html