Java ant script does not show warnings

﹥>﹥吖頭↗ 提交于 2019-12-10 17:34:39

问题


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.

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

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

Thank you for your answers.


回答1:


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"/>



来源:https://stackoverflow.com/questions/12213923/java-ant-script-does-not-show-warnings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!