在Mac上使用jinfo 命令直接出错了 完整错误信息如下
(base) leon@jiyeliaowuhendeMacBook-Pro develop % jinfo -flags 42447
Attaching to process ID 42447, please wait...
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach symbolicator to the process
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach symbolicator to the process
at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.execute(BsdDebuggerLocal.java:169)
at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach(BsdDebuggerLocal.java:287)
at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:671)
at sun.jvm.hotspot.HotSpotAgent.setupDebuggerDarwin(HotSpotAgent.java:659)
at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:341)
at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
at sun.jvm.hotspot.tools.JInfo.main(JInfo.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.tools.jinfo.JInfo.runTool(JInfo.java:108)
at sun.tools.jinfo.JInfo.main(JInfo.java:76)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: Can't attach symbolicator to the process
at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach0(Native Method)
at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.access$100(BsdDebuggerLocal.java:65)
at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1AttachTask.doit(BsdDebuggerLocal.java:278)
at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.run(BsdDebuggerLocal.java:144)
在attach进程的时候发生了错误
首先去oracle java (https://www.oracle.com/java/) 官网搜一下错误 看看有没有对应的解决办法
发现有个3个bug单 前两个都是对于MacOS的我们进去看下
https://bugs.java.com/bugdatabase/view_bug.dobug_id=8160743
https://bugs.java.com/bugdatabase/view_bug.dobug_id=8161164
https://bugs.java.com/bugdatabase/view_bug.dobug_id=8160376
官网推荐我们升级到jdk9 这个版本改bug已经被修复
我们直接使用下jdk16的环境 再来 试试
果然升级一下jdk就好了 。。。
再换个 jdk14试试
总结一下
MAC 遇到 Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can’t attach symbolicator to the process
建议升级jdk 版本的话 jdk9 以及jdk9以上 (这里测试了jdk 14 和 jdk16 )