• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is deprecated API meant?

 
Mindy Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am compiling a java app in dos command line:
javac Test.java
then it show me this message:
Note: Test.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
If i compile it user this:
javac -d Test.java
It has not problem at all!
Can anyone explain why i got this message?
I appreciate for you help!
Cheers!
Mindy
 
Junilu Lacar
Bartender
Pie
Posts: 7465
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been answered before but I want to get over the 500 posts hump by COB
Deprecated in this context means that use of the method you are calling is no longer recommended and obsolete (although you may still do so if you insist). You should go to the JavaDoc and see what the recommended replacement for the obsolete API is and use that instead.
The -deprecated compile option just tells the compiler to shut up about deprecated APIs already (You know what you're doing, right? )
 
David McCormick
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and that it will be probably not be in a future version of the API.
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deprecated means certain old ways of doing things,no longer recommended and might not be supported in a future major release. To help you convert your programs well ahead of time, the Java compiler warns you whenever you compile a program that uses deprecated API.
To see a list of places where your program uses deprecated API, use javac -deprecation. You might see many warnings. Don't panic! Your program will continue to work for a long time. However, you might want to make plans to convert it. And any new code you write should use the new API, if at all possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic