Java – cannot prevent ant from generating compiler sun proprietary API warnings

I call javac from this ant script:

<javac srcdir="src" 
   destdir="build/classes" source="1.6" 
   target="1.6" debug="true" encoding="Cp1252"
   Nowarn="true">

But it still raises compiler warnings in the output:

[javac] Compiling 73 source files to C:\IKOfficeRoot\Java\ERP\Framework\build\classes

[javac] C:\IKOfficeRoot\Java\ERP\Framework\src\de\ikoffice\util\LoggerFactory.java:49: warning: sun.reflect.Reflection is Sun proprietary API and may be removed in a future release
[javac]         return Logger.getLogger(Reflection.getCallerClass(2));
[javac]                                 ^
[javac] Note: C:\IKOfficeRoot\Java\ERP\Framework\src\de\ikoffice\db\SingleShotResultSet.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning

I tried, too

<compilerarg line="-Xlint:-unchecked -Xlint:-deprecation"/>

and

<compilerarg value="-Xlint:none"/>

But it has no effect How do I clear warnings?

Solution

Set - xdignore symbol. The file option is added to the javac command line that works for me

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>