How can I view the classpath and jvm args of an executing java program in windows

后端 未结 3 1760
既然无缘
既然无缘 2021-02-07 23:07

In *nix I just do ps -ef | grep java to see the jvm args and classpath of an executing java program. How can I see it in windows command prompt? I want to see if ce

3条回答
  •  轮回少年
    2021-02-08 00:07

    You can write a small application to connect via JMX and query the mbean java.lang.Runtime. It has an attribute "ClassPath".

    import java.lang.management.*
    
    ManagementFactory.getRuntimeMXBean().getClassPath()
    

提交回复
热议问题