Java ant 脚本不显示警告 [英] Java ant script does not show warnings
问题描述
我有一个 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屋!