Eclipse远程调试、断点——.java VS .class混淆
我正在 Eclipse 中远程调试 Java 应用程序。 (一堆 Alfresco 项目在 ZIP 文件中附加了源代码。)
断点确实有效,但是:
1) 每当我在 *.class 文件中设置断点时,到达断点时 Eclipse 都会打开 *.java 文件。
2)当我在 *.java 文件中设置断点时,会创建一个新断点(显然独立于 *.class 中设置的断点),并且在断点中列表它不提供“转到文件”选项。
3) *.java 文件中永远不会显示表示断点的项目符号;无论断点是从 *.class 还是 *.java 文件中创建的。
(当然,如果不是 2 和 3,我会很乐意坚持使用 *.java 文件。)
我做错了什么吗? ...或者这是常见的行为,而我对此无能为力?
I'm remotely debugging a Java application in Eclipse. (Bunch of Alfresco projects with attached sources in ZIP-files.)
Breakpoints do work, but:
1) Whenever I set a breakpoint in *.class file Eclipse opens *.java file when the breakpoint is reached.
2) When I set the breakpoint from within the *.java file a new breakpoint is created (apparently independent on the one set in *.class), and in the breakpoints list it does not offer 'Go to file' option.
3) The bullet indicating a breakpoint is never displayed in the *.java file; Regardless of whether the breakpoint has been created from within *.class or *.java file.
(If it wasn't for 2 and 3 I would happily stick with *.java files, of course.)
Am I doing something wrong? ...or is this usual behaviour and there's nothing I can do about it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查项目的“Java 构建路径”首选项中的“订单和导出”。
(或在运行配置启动器的“类路径”选项卡中)
对于本地项目,如果输出目录(“
build
”或“bin
”或“cls
' 或 ...) 出现在您正在调试的“src
”之前,您将遇到这种“断点”混淆。对于远程项目,如果 jar 附加了源代码,那么它应该可以工作。
Check your "Order and Export" in the "Java Build Path" preference of your project.
(or in the 'Classpath' tab' of your Run Configuration Launcher)
For a local project, if the output directory ('
build
' or 'bin
' or 'cls
' or ...) appears before the 'src
' of what you are debugging, you will experience that kind of "breakpoint" mix-up.For a remote project, if the jar has the sources attached to them, it should work.