When I compile, javac outputs:
Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.`
I wish to suppress this warning. Trying -Xlint:none does not seem to help.
Place the @SuppressWarnings annotation at the declaration of the class, method, field, or local variable that uses a deprecated API. The @SuppressWarnings options are: @SuppressWarnings("deprecation") — Suppresses only the ordinary deprecation warnings.
Deprecation warnings are a common thing in our industry. They are warnings that notify us that a specific feature (e.g. a method) will be removed soon (usually in the next minor or major version) and should be replaced with something else.
A deprecated API is one that you are no longer recommended to use, due to changes in the API. While deprecated classes, methods, and fields are still implemented, they may be removed in future implementations, so you should not use them in new code, and if possible rewrite old code not to use them.
From what I can tell in the docs, you can't do it on the command-line.
According to the javac
documentation, -Xlint:none only disables warnings "not mandated by the Java Language Specification". It appears that warning you of the use of deprecated APIs is managed by the language spec.
Your best option would be to fix the use of deprecated APIs. However, an option would be to add the @SuppressWarnings("deprecation")
annotation to the classes or methods that are using the deprecated APIs.
Two possible ways:
@SuppressWarnings("deprecation")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With