如何在 ECLIPSE 中调试 .class 文件?
我正在使用 Eclipse 3.5,并将 src.zip 附加到 Eclipse 中的全局设置中.Windows--> Preferences -->Java -->Installed JREs -->rt.jar - 源附件 - ...../jdk/src.zip
I am using Eclipse 3.5 and I attached the src.zip to my global settings in Eclipse. Windows--> Preferences -->Java -->Installed JREs -->rt.jar - Source attachment - ...../jdk/src.zip
我能够成功地进入 java 核心库 .class 文件并查看源代码.我构建了一个使用 LinkedList 的类,并在 LinkedList 类中设置了一个断点.
I am successfully able to step in the java core library .class files and view the source code. I building a Class which uses the LinkedList and I have set a breakpoint inside the LinkedList class.
当我在源代码(我的项目)中调试断点时运行良好,但是当我需要进入 java 核心库 .classes 时,我在 Eclipse 中收到以下错误
When I debug the breakpoints in my source code (my projects) are working good but when I need to step into the java core lib .classes I get the following error in my Eclipse
由于缺少行号属性,无法在 java.util.LinkedList 中安装断点.修改编译器选项以生成行号属性.
我在 Preferences 中检查了我的编译器设置,发现所有选项都选中了 true.如果有人能帮我解决这个问题,那就太好了.
I checked my complier settings in Preferences and found all options checked true. It would to great if someone can help me resolve this issue.
提前致谢.
推荐答案
您可能已将编译器设置为在您的类文件中包含调试信息,但 rt.jar 中的类文件不是这样编译的.您需要重新编译 rt.jar 中类的所有源代码(不适合胆小的人),或者 下载jdk 的调试版本.
You may have the compiler set to include debugging information in YOUR class files, but the class files in rt.jar weren't compiled that way. You need to either recompile all the source for the classes in rt.jar (not for the faint of heart), or download a debug build of the jdk.
相关文章