File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes what is deprecated API meant? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is deprecated API meant?" Watch "what is deprecated API meant?" New topic

what is deprecated API meant?

Mindy Wu
Ranch Hand

Joined: Jan 12, 2001
Posts: 121
I am compiling a java app in dos command line:
then it show me this message:
Note: uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
If i compile it user this:
javac -d
It has not problem at all!
Can anyone explain why i got this message?
I appreciate for you help!
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

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? )

Junilu - [How to Ask Questions] [How to Answer Questions]
David McCormick

Joined: Jun 26, 2001
Posts: 5
and that it will be probably not be in a future version of the API.
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
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.

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
I agree. Here's the link:
subject: what is deprecated API meant?
It's not a secret anymore!