在ant编译java文件时产生debug信息

使用ant编译java文件时,如果没有设置debug属性,则不会产生编译信息,ant的默认设置是不打印编译信息。

如果想在编译过程中显示编译信息,需设置debug属性为true,并且设置debugLevel,如下代码所示:

ant file - build.xml
1
<javac ... debug="true" debuglevel="lines, vars, source">

ant的官方文档:

debug Indicates whether source should be compiled with debug information; defaults to off. If set to off, -g:none will be passed on the command line for compilers that support it (for other compilers, no command line argument will be used). If set to true, the value of the debuglevel attribute determines the command line argument. No
debuglevel Keyword list to be appended to the -g command-line switch. This will be ignored by all implementations except modern, classic(ver >= 1.2) and jikes. Legal values are none or a comma-separated list of the following keywords: lines, vars, and source. If debuglevel is not specified, by default, nothing will be appended to -g. If debug is not turned on, this attribute will be ignored.

这里要注意的是如果设置debug属性为true,但是没有设置debuglevel属性,编译时还是不会打印信息,因为debuglevel的默认值是none,只有单独设置为lines, vars, source或其组合才会打印出信息。

转载于:https://www.cnblogs.com/kingzzm/p/3325383.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值