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

Categories

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

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

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...