posts - 495,  comments - 11,  trackbacks - 0

有时候将自己的程序打包成jar文件作为类库调用,出错时,遇到自己的jar包里的类文件报异常信息时,无法打印出行号,而是(Unknown Source)

解决办法:在编译任务中加上如下参数debug="true" debuglevel="lines,vars,source"

例如:

<target name="compile" depends="prepare" description="编绎源码">
   <javac encoding="utf-8" destdir="${build.dir}" source="1.5" target="1.5"
        deprecation="false" optimize="false" failonerror="true"
        debug="true" debuglevel="lines,vars,source">
     <src refid="src-paths" />
     <classpath refid="lib-paths" />
   </javac>

   <copy todir="${build.dir}" preservelastmodified="true">
     <fileset dir="${src.dir}">
       <include name="**/*.txt"/>
       <include name="**/*.xml"/>
       <include name="**/*.dtd"/>
       <include name="**/*.properties"/>
     </fileset>
   </copy>
</target>

posted on 2010-03-14 20:26 jadmin 阅读(135) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: