Java ant 脚本不显示警告 [英] Java ant script does not show warnings

查看:33
本文介绍了Java ant 脚本不显示警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 1.4 java 代码,我想用 1.5 编译器编译它,因为我想查看所有警告消息.我在 javac 中添加了 -Xlint 选项,但输出似乎没有变化,但我知道代码中至少有几个警告.

I have a 1.4 java code and I want to compile it with a 1.5 compiler because I would like to see all warning messages. I added the -Xlint option to javac, but it seems there were no changes in the output, but I know there is at least a couple of warnings in the code.

我将这两行添加到我的 ant 脚本的编译目标标签中:

I added these two lines to my ant script's compile target tag:

<compilerarg value="-Xlint:all"/>
<compilerarg line="-Xmaxwarns 10000"/>

感谢您的回答.

推荐答案

您同时使用了 value 和 line 属性.Compilerarg 需要正是其中之一",请参阅文档.尝试只使用一行,例如:<compilerarg line="-Xlint:all -Xmaxwarns 10000"/>

You have used value and line attributes at the same time. Compilerarg requires "Exactly one of these", see docs. Try using only line, like: <compilerarg line="-Xlint:all -Xmaxwarns 10000"/>

这篇关于Java ant 脚本不显示警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆