Eclipse远程调试、断点——.java VS .class混淆

发布于 2024-09-19 16:07:32 字数 418 浏览 5 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娜些时光,永不杰束 2024-09-26 16:07:32

检查项目的“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文