Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

java - Cannot stop ant from generating compiler Sun proprietary API warnings

I call javac from my ant script like this:

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

But it still throws compiler warnings in the output:

[javac] Compiling 73 source files to C:IKOfficeRootJavaERPFrameworkuildclasses

[javac] C:IKOfficeRootJavaERPFrameworksrcdeikofficeutilLoggerFactory.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:IKOfficeRootJavaERPFrameworksrcdeikofficedbSingleShotResultSet.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 also tried

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

and

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

but this has no effect either. How to I remove the warnings?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

adding the -XDignore.symbol.file option to the javac command line worked for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...