This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is deprecated API meant?" Watch "what is deprecated API meant?" New topic
Author

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:
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

Joined: Feb 26, 2001
Posts: 4442
    
    5

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
Greenhorn

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: what is deprecated API meant?
 
Similar Threads
ClassPath problem
Note messages after compiling an APPLET
JTable dates
one question about the Date Class!
Mouse shift event coding - to trigger a predetermined sequence of images to a GUI