问题
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