在尝试设置断点时,我在Eclipse中得到这个奇怪的错误。

Unable to insert breakpoint Absent Line Number Information

我勾选了编译器选项的复选框,但运气不好。


当前回答

从Spring AOP得到这个消息(似乎来自CGLIB库)。点击忽略似乎工作正常,我仍然可以调试。

其他回答

确保运行时的主类所在的项目与包含断点的类所在的项目相同。如果不是,请确保两个项目都在运行配置的类路径中,并且出现在任何jar和类文件夹之前。

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文件的版本,清理并重新编译源代码,最后刷新环境。我希望这能对其他人有用。

在Eclipse中调试时如何修复断点错误? 只替换这几行。

    eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

我试图调试日志管理器,需要将jre更改为jdk,然后在“主”选项卡中选择这个jdk,调试配置的“Java运行时环境”|“运行时jre”,然后一切正常。

我在一个特定的项目中遇到了同样的问题,我一直试图重置窗口中的行号属性->首选项…然后我意识到每个项目都有自己的行号属性设置。右键单击项目,进入属性,选择JavaCompiler,并选中“添加行号属性…”