在Eclipse中进行调试时,如何解决断点错误? [英] How to fix breakpoint error when debugging in Eclipse?

查看:273
本文介绍了在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.


  1. 窗口>首选项:Java>编译器>类文件生成下,所有选项都必须为True

  2. 在项目的 .settings 文件夹中,查找名为 org.eclipse.jdt.core.prefs 的文件。验证或设置 org.eclipse.jdt.core.compiler.debug.lineNumber = generate

  3. 添加 build.xml 中的debug = true 标志,就像这样:< javac srcdir = ./ src / java destdir = ./ bin debug = true>

  1. Under Window > Preferences: Java > Compiler > Classfile Generation, all options have to be to True
  2. In .settings folder of your project, look for a file called org.eclipse.jdt.core.prefs. Verify or set org.eclipse.jdt.core.compiler.debug.lineNumber=generate
  3. Add the debug=true flag in the build.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆