在尝试设置断点时,我在Eclipse中得到这个奇怪的错误。
Unable to insert breakpoint Absent Line Number Information
我勾选了编译器选项的复选框,但运气不好。
在尝试设置断点时,我在Eclipse中得到这个奇怪的错误。
Unable to insert breakpoint Absent Line Number Information
我勾选了编译器选项的复选框,但运气不好。
当前回答
首先,我建议确定问题是与项目相关还是与单个测试文件相关。试着在调试模式下运行任何其他测试文件。
如果问题只适用于一个文件,这可能与自我嘲笑有关(就像我的情况一样)。否则,编译器/构建设置应该被更改。在之前的评论中已经描述过了。
我只是想强调一下。这已经足够我浪费时间在修复项目设置,而这是完全没有必要的:)
其他回答
在使用Spring Tool Suite (STS)启动Java EE项目时,我们也会遇到这个消息,但是我们可以忽略这个消息,因为一切都很好。
确保运行时的主类所在的项目与包含断点的类所在的项目相同。如果不是,请确保两个项目都在运行配置的类路径中,并且出现在任何jar和类文件夹之前。
以上这些都对我不起作用。 下面的解决方案终于奏效了。 调试配置->类路径->用户条目->(添加要调试的项目的src文件夹)
We have very useful information to solve this problem already, but in my specific case, the problem was that as I did an update to my project from the repository, new classes were generated with the compiled source from the newest code. The problem is that I forgot to change the versions of the projects in my POM files and as the breakpoints were set on the new code and the POM files were still pointing to old versions that were available on the JAR files of a previous compilation, the classes from the JAR files were chosen and not the classes from the new code.
在恢复中,为了解决这个问题,我只需要更新主项目的POM文件的版本,清理并重新编译源代码,最后刷新环境。我希望这能对其他人有用。
这招对我很管用:
在窗口——>首选项——> Java——>编译器——>类文件生成下,所有选项都必须为True。 在build.xml <javac>任务中使debug="true"。 通过ant生成的war在tomcat中部署应用程序 在Debug模式下重新启动Tomcat