在Eclipse中进行调试时,如何解决断点错误? [英] How to fix breakpoint error when debugging in Eclipse?
问题描述
需要调试JAR文件 ProA,因此将源代码导入项目
,但是在尝试设置断点时Eclipse中出现一个奇怪的错误。
详细信息如下:
Need to debug a JAR file "ProA", so import the source code in the project, but there is a strange error in Eclipse while trying to set a breakpoint. Detail as below:
Unable to install breakpoint due to missing line number attributes.
Modify compiler options to generate line number attributes.
我已经尝试了几种方法来解决,但都失败了。
I have try to several method to solve, but failed.
- 在窗口>首选项:Java>编译器>类文件生成下,所有选项都必须为True
- 在项目的
.settings
文件夹中,查找名为org.eclipse.jdt.core.prefs
的文件。验证或设置org.eclipse.jdt.core.compiler.debug.lineNumber = generate
- 添加
build.xml
中的debug = true< javac srcdir = ./ src / java destdir = ./ bin debug = true>
- Under Window > Preferences: Java > Compiler > Classfile Generation, all options have to be to True
- In
.settings
folder of your project, look for a file calledorg.eclipse.jdt.core.prefs
. Verify or setorg.eclipse.jdt.core.compiler.debug.lineNumber=generate
- Add the
debug=true
flag in thebuild.xml
, just like this:<javac srcdir="./src/java" destdir="./bin" debug="true">
任何帮助都会赞赏。
推荐答案
我遇到了同样的问题,但是阅读您的帖子有助于我解决我的问题。我将 org.eclipse.jdt.core.prefs
更改如下:
I have had the same problem, but reading your post helped me resolve mine. I changed org.eclipse.jdt.core.prefs
as follow:
之前:
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
之后:
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
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.7
在Project> Properties> Java Compiler中修改这些选项的另一种方法。因此,无需手动修改 org.eclipse.jdt.core.prefs
文件。在那里,您需要确保选中 Classfile Generation 选项。
Another way to modify these options within the Project> Properties> Java Compiler. So, there is no need to modify manually the org.eclipse.jdt.core.prefs
file. There you need to make sure that the Classfile Generation options are checked.
这篇关于在Eclipse中进行调试时,如何解决断点错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!