获取jvm的PID
[Java]代码
import java.lang.management.ManagementFactory; String pname = ManagementFactory.getRuntimeMXBean().getName(); String pid = null; if(null!=pname){ pid = pname.split("@")[0]; } System.out.println("PID:"+pid);
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/10376.html