根据oracle文档http://docs.oracle.com/javase/6/docs/technotes/guides/visualvm/jmx_connections.html 目标应用程序应该与 Java VisualVM 在同一主机上运行,但由与启动 Java VisualVM 的用户不同的用户启动。但是,在我的情况下,我以假设 X 用户身份登录。并且我正在启动 VisualVM 和目标应用程序。如何在同一本地主机上由一个用户运行 VisualVM 并由另一用户运行目标应用程序?
最佳答案
您访问的是正确的页面。您需要按照页面描述创建显式 JMX 连接:
When Are Explicit JMX Connections Necessary?
- The target application is running on the same host as Java VisualVM but was started by a different user than the one who started Java VisualVM. Java VisualVM discovers running applications using the jps tool, which can only discover Java applications started by the same user as the one who starts the Java VisualVM tool.
关于visualvm - 使用可视VM的本地jmx连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13696686/