0

Possible Duplicate:
The constructor Date(…) is deprecated. What does it mean? (Java)

I'm getting this message when I compile my code.

H:\Project\MyGui.java uses or overrides a deprecated API.
Recompile with -Xlint:deprecation for details.

I've never seen it before, but in no way does it stop the programing running properly.

Could someone please explain it and tell me how to rectify it?

Community
  • 1
  • 1
Dave Fisher
  • 1,033
  • 3
  • 10
  • 10

1 Answers1

4

So you are using or overriding a method that has been marked as deprecated. If you want to know exactly which one, you'll have to add -Xlint:deprecation to your javac arguments.

A deprecated API will usually have a recommended alternative in the Javadoc associated with it, so it'll tell you what to use instead of it.

Romain
  • 12,679
  • 3
  • 41
  • 54
  • what do you mean, you'll have to add -Xlint:deprecation to your javac arguments. – Dave Fisher Nov 11 '11 at 14:32
  • When you use `javac` to compile your code, you'll have to pass it an additional argument, that is `-Xlint:deprecation`, so it'll look like `javac -Xlint:deprecation MyGUI.java`. If you're using an IDE, it'll have a setting that allows you to add compiler arguments somewhere. – Romain Nov 11 '11 at 14:34