3

Possible Duplicate:
Cannot stop ant from generating compiler warnings

How to suppress this warning:

sun.reflect.Reflection is Sun proprietary API and may be removed in a future release

using @SuppressWarnings in Oracles javac (1.6)?

According to this blog using "all" should work but it does not. Does anybody know the correct string?

Community
  • 1
  • 1
ceving
  • 21,900
  • 13
  • 104
  • 178

1 Answers1

4

Try adding the

-XDignore.symbol.file

option to the javac command line

hope this helps

EDIT REF : OPENJDK

EXAMPLE 6

To compile your source you can either use the javac from JDK7 with -source 1.6 -target 1.6, or run the javac from your patched JDK6 with -XDignore.symbol.file=true. This flag is necessary because javac uses a symbol file to determine packages in the com/sun namespace and will not recognize the new sctp classes as they are not in this symbol file.

Mukul Goel
  • 8,387
  • 6
  • 37
  • 77
  • This seems to help but I have no idea why. What does this do? And why does it suppress warnings? And what of the things I probably do not want does it do? – ceving Oct 05 '12 at 12:30
  • Please refer to the edit – Mukul Goel Oct 05 '12 at 12:38
  • I did not get an error about a missing class but a warning about a proprietary API. How can an information about a "sctp" class (whatever his might be) changing the API being proprietary? But anyway... – ceving Oct 05 '12 at 13:29
  • hmmm.. not very sure myself but I faced similar issues sometime back and did some research and what I could make out of it was that the sun.reflect.Reflection package is not referenced from the symbol file(mentioned above) so it does not try to load that module and hence suppress the warning.. anyway.. not much information available..but this does the trick. :-) – Mukul Goel Oct 05 '12 at 14:38