I tried compiling my java program and it gave me the following error:

Note: DnldURL.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

What does this mean?

8 Years
Discussion Span
Last Post by majestic0110

Hi B89Smith, you can add the -deprecation option to the java command, as per the message, and recompile:

javac DnldURL.java -deprecation

You are using a part of the API that is now obsolete. The messages from the compile with the "-deprecation" switch will give you the details, then you ought to refer to the appropriate class documentation for what part of the API you should use as a replacement. I hope this helps.

See here for more information:


and here :


A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists. Compilers warn when a deprecated program element is used or overridden in non-deprecated code.

Edited by majestic0110: n/a

Votes + Comments
Helpful info
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.