读书人

Ant封装 远程 - debug unable to i

发布时间: 2012-10-24 14:15:58 作者: rapoo

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中可能会出现的错误:

读书人网 >编程

热点推荐