为什么`sun.jvm.hotspot.debugger.DebuggerException:无法打开二进制文件`?

时间:2016-12-19 12:23:36

标签: java jvm

在linux中,我得到了一个由java生成的核心文件,它无法通过jvisualvm打开,所以我想把它翻译成堆转储文件,但是发生了一些错误:

[root@root_test-1 game]$ jmap -J-d64 -dump:format=b,file=core.10255.dump java ./core.10255
Attaching to core ./core.10255 from executable java, please wait...
Error attaching to core file: cannot open binary file
sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file
        at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
        at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286)
        at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:673)
        at sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:611)
        at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:337)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
        at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:191)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
        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:497)
        at sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)

如何解决?

1 个答案:

答案 0 :(得分:1)

看起来您使用的是旧版本(JDK8更新版本为60或更低版本)的java版本。您提到的问题是已知问题https://bugs.openjdk.java.net/browse/JDK-8039995这已在JDK9中修复并向后移植到不同的较低版本(JDK8更新65是最低版本)。您需要升级Java以使用最新版本来避免此问题。

相关问题