2016-12-19 117 views
1

在linux中,我得到了在Java生成的核心文件,它不能被打开jvisualvm,所以我想它翻译成一个堆转储文件,但发生了一些错误:为什么`sun.jvm.hotspot.debugger.DebuggerException:无法打开二进制文件?

[[email protected]_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) 

如何解决它?

回答

0

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

相关问题