当前位置: 代码迷 >> 综合 >> “Unable to install breakpoint due to missing line number attributes,Modify compiler options togenera
  详细解决方案

“Unable to install breakpoint due to missing line number attributes,Modify compiler options togenera

热度:63   发布时间:2023-12-21 20:18:54.0

Unable to install breakpoint in处理方法

  (2012-12-27 10:16:44)
转载
标签: 

杂谈

分类: 有java的哈皮时光
今天调试程序的时候,eclipse 弹出来一个
“Unable to install breakpoint due to missing line number attributes,Modify compiler options togenerate line number attributes" 
遇到这个错误时找到的解答方案汇总:  
1、使用Ant编译时,未打开debug开关,在写javac 任务时确认debug=true,否则不能调试。 THe settings for the eclipse compiler don't affect the ant build and even if you launch the ant build from within eclipse. ant controls it's own compiler settings.you can tell ant  to   generate debugging info like this 'javac ... debug="true".../>(我的问题是因为这个原因);  
2、编译器的设置问题,window->preferences->java->Compiler在compiler起始页,classfile Generation区域中确认已经勾选了All line number attributes  to  generated class files。 如果已经勾选,从新来一下再Apply一下。或者从项目层次进行设定,项目属性->java compiler同样在起始页,确定已经勾选  
Eclipse报的这个错,无非就这两个原因造成的  

回答2:  
以前总是被这个问题困绕,也找不到解决的办法,无意间才明白他是怎么回事,  
这个问题根本原因是:你eclipse里的project 和  
deploy 到web container(tomcat)里的project  
对应不起来.  
解决的办法:从eclipse里redeploy,然后从eclipse里run,或者到web container里先把the project删除,在从eclipse里deploy,然后从eclipse里run.


Eclipse Unable to install breakpoint in   的问题总算解决了,重装eclipse无效,最后只有到window-preferences-java-compiler下面
把Add line number attributes..前的勾去掉,然后apply-OK。再window-preferences-java-compiler把勾打上,再apply-OK,问题才解决了,网上有人说这个问题是因为既使用ant编译又使用eclipse编译造成的,依然是困惑中。。。  




  相关解决方案