averainy's Blog
averainy
Links
Java
01
Mar 2022
获取当前Java程序PID
获取当前Java程序PID jvm1.8以上通用方式: String pid = ManagementFactory.getRuntimeMXBean().getName(); pid = pid.substring(0, pid.indexOf("@"));