• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

what is deprecated API meant?

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 17065
298
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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? )
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and that it will be probably not be in a future version of the API.
 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic