在尝试设置断点时,我在Eclipse中得到这个奇怪的错误。
Unable to insert breakpoint Absent Line Number Information
我勾选了编译器选项的复选框,但运气不好。
在尝试设置断点时,我在Eclipse中得到这个奇怪的错误。
Unable to insert breakpoint Absent Line Number Information
我勾选了编译器选项的复选框,但运气不好。
当前回答
在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
其他回答
我有同样的错误与JBoss 7.1.. 我和泽菲罗做了同样的事。只是忽略了错误,我能够正常放置断点。 在我的情况下,我正在构建思想蚂蚁生成器,这是我的javac任务:
<javac
srcdir="${src.dir}"
destdir="${build.classes.dir}"
includeantruntime="false"
debug="${debug}"
verbose="false"
debuglevel="lines,vars,source"
source="1.6"
target="1.6">
<!-- Sppressing warning for setting an older source without bootclasspath
(see: https://blogs.oracle.com/darcy/entry/bootclasspath_older_source) -->
<compilerarg value="-Xlint:-options"/>
<classpath>
<fileset dir="${lib.dir}" includes="*.jar" />
<fileset dir="${jboss.lib.dir}" includes="**/*.jar" />
</classpath>
</javac>
If someone is trying to debug Java's source code, then, this is the only solution that worked for me. Most of the above answers talk about setting the Compiler option to generate line numbers.But, if want to debug Java's source code (say java.util.HashMap), then the above options may not work for you. This is because , the project from where you intend to debug the source code is having the Java Build Path --> Library --> JRE System Library pointing to the jre jar instead of the jdk jar. The classes bundled inside jre jar have already been pre-compiled with a specific option, that will not honor the Compiler option settings. Solution, is to reconfigure your project to have the JRE System Library point to the jdk jar. The classes inside your jdk jar will honour the Compiler option settings. So, once you update your project's JRE System Library to point to the jdk jar, debug on Java source code will start working.
我尝试了之前的大部分解决方案,但还是遇到了问题。 这就是我接下来所做的:
从Eclipse中删除应用程序 停止服务器 从webapps中删除应用文件夹 从服务器中的临时文件夹中删除内容 从服务器中的工作文件夹中删除内容 在Eclipse上重新打开应用程序 启动服务器
可能有些步骤是不需要的,但“以防万一”。
因此,如果前面的解决方案仍然不适合你。试试这个。 我希望这对你有所帮助;-)
我在试图从Eclipse以调试模式启动Tomcat时遇到了这个问题。我有一个ANT构建文件负责编译和部署。在将调试标志设置为true(如其他答案所述)并重新部署应用程序后,它可以正常工作:
<javac srcdir="./src/java" destdir="./bin" debug="true">
注意:如果您刚刚添加了调试标志并重新编译,那么仍然需要将应用程序重新部署到服务器,因为Eclipse就是在服务器上调试类文件的。很明显,但很容易花一个小时左右的时间挠头,想知道为什么它不管用(相信我)。
这解决了我的问题:
窗口->首选项->服务器->运行时环境 Apache Tomcat ->编辑 选择JDK而不是JRE