java断点找错,在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.

Under Window > Preferences: Java > Compiler > Classfile Generation, all options have to be to True

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

Add the debug=true flag in the build.xml, just like this:

Any help will be appreciated.

解决方案

I have had the same problem, but reading your post helped me resolve mine. I changed org.eclipse.jdt.core.prefs as follow:

BEFORE:

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

AFTER:

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

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值