Eclipse - 由于缺少行号属性,无法安装断点 [英] Eclipse - Unable to install breakpoint due to missing line number attributes

查看:6505
本文介绍了Eclipse - 由于缺少行号属性,无法安装断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 无法插入断点缺席行号信息

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

解决方案

我在Eclipse 3.4.1中有相同的错误消息,SUN JVM1.6.0_07连接到Tomcat 6.0(在不同的机器上以调试模式运行,Sun JVM1。 6.0_16,调试连接正常工作)。



窗口 - >首选项 - > Java - >编译器 - >类文件生成:添加已经检查了生成的类文件的行号属性。我做了一个干净,重新编译。我没有选中它,重新编译,检查它,重新编译。我确保项目确实使用了全局设置。仍然是同样的消息。



我切换到ant构建,使用

 < javac srcdir =./ src / javadestdir =./ bindebug =true> 

仍然是同样的消息。



没有发现什么导致这个消息,为什么它不会消失。虽然它似乎与运行的Tomcat调试会话有关:断开连接后,重新编译可以解决问题。但是,在将调试器连接到Tomcat或在连接的调试会话期间设置新的断点时,它再次出现。



但是,结果是消息错误:我确实能够在调试之前和期间调试和设置断点( javap -l <​​/ em>也显示行号)。所以只是忽略它:)


I am getting this strange error in Eclipse while trying to set a breakpoint.

Unable to insert breakpoint Absent Line Number Information

I ticked the checkbox from Compiler options but no luck.

解决方案

I had the same error message in Eclipse 3.4.1, SUN JVM1.6.0_07 connected to Tomcat 6.0 (running in debug-mode on a different machine, Sun JVM1.6.0_16, the debug connection did work correctly).

Window --> Preferences --> Java --> Compiler --> Classfile Generation: "add line number attributes to generated class file" was checked. I did a clean, recompile. I did uncheck it, recompile, check it, recompile. I made sure the project did use the global settings. Still the same message.

I switched to ant build, using

<javac srcdir="./src/java" destdir="./bin" debug="true">

Still, same message.

I didn't find out what caused this message and why it wouldn't go away. Though it seemed to have something to do with the running Tomcat debug session: when disconnected, recompiling solves the issue. But on connecting the debugger to Tomcat or on setting new breakpoints during a connected debug session, it appeared again.

However, it turned out the message was wrong: I was indeed able to debug and set breakpoints, both before and during debugging (javap -l did show line numbers, too). So just ignore it :)

这篇关于Eclipse - 由于缺少行号属性,无法安装断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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