首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Ant封装 远程 - debug unable to install breakpoint in…

2012-10-24 
Ant打包 远程----debug unable to install breakpoint in……unable ? to? install ? ? breakpoint ? in ? .

Ant打包 远程 ---- debug unable to install breakpoint in……

unable ? to? install ? ? breakpoint ? in ? ...(file ? name)? due ? to ? missing ? line ? number ?attributes.?
modify ? complier ? options ? to? generate ? line ? number ? attributes.?

?

?

转载:http://yimi128.iteye.com/blog/907079

?

?

场景:

?

远程服务器上的java程序使用ant编译,本地java程序使用eclipse编译,远程调试服务器上的java程序。

?

基本的条件比如要用相同版本的jdk编译是前提,这里着重强调相关的编译条件。

?

设置?

?

1.本地eclipse编译时,需要工程右键->属性->Java Compiler->Classfile Generation

???? 勾选下面的Add?variable attributes?...

??????????????????? Add?line number attributes?...

??????????????????? Add?source file name?...

??????????????????? Preserve unused local variables

?

2.远程服务器上使用ant编译时,javac任务添加属性debug="on" debuglevel="vars?,lines?,source?"

?

?

?

结论?

?

对比上面的设置,我们可以看出,我们要能按行debug,并且看到变量值的话,要保证eclipse和ant编译的参数都相同。

?

当然这只是调试时需要的配置,真正上线运行的代码,编译时要关闭debug信息,即debug="off"。

?

在eclipse中可能会出现的错误:

  • 设置断点时,报:Unable to install breakpoint due to missing line number attributes. Modify compiler options to generate line number attributes错误。

    ????? 解决办法:首先按上面的第一条配置eclipse,另外在ant的javac任务中打开debug属性,即debug="on"

    ?

    • 现在可以调试了,但是只能看到this的变量,local variables都没有显示

      ????? 解决办法:相信你看了上面的2条应该知道怎么办了吧?Ant封装 远程  -   debug unable to install breakpoint in…

热点排行