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

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

问题描述

我有一个1.4的java code,我想用1.5编译器来编译它,因为我希望看到所有的警告信息。我加入了-Xlint选项的javac,但似乎有在输出没有改变,但我知道至少有一对情侣在code警告。

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脚本的compile目标标记:

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

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

感谢您的答案。

推荐答案

您已经使用的价值和线属性在同一时间。 Compilerarg要求正是其中之一,见文档。尝试使用才行,如:&LT; compilerarg行= - Xlint:所有-Xmaxwarns 10000/&GT;

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天全站免登陆