• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am getting following error at compile time. What does it shows & how to remove this error.

Thanks in advance
PC


---------- NewProgramcompile ----------
Note: TCP_Finger_Client.java uses or overrides a deprecated API.
Note: Recompile with -Xlint eprecation for details.

Output completed (4 sec consumed) - Normal Termination
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not actually an error. As far as I can see, your program has compiled successfully. But there is a warning.

The warning is saying that you have used one or more classes or methods from the Java API that are marked as deprecated. That means that problems have been identified with them and Sun recommend they no longer be used.

If you can adjust the command line used to compile your code, do what the message suggests and add the -Xlint option. This will tell you more about what deprecated method(s) you are using.

If you can't do that, you'll have to go through your code and look up all the Java API methods you are using in the documentation, to see which one(s) are deprecated.

Some deprecations are "stronger" than others. For instance, Thread.stop() is extremely seriously broken and must never be used, as your program will probably deadlock. In comparison, some of the deprecations in javax.swing might make your GUI look a bit odd, but won't make your code die.

Usually, the API documentation suggests what to use instead of the deprecated method. If you find you really have to use a deprecated method, I believe there is a compiler option to suppress the complaining messages; this is a last resort, though.
[ August 16, 2006: Message edited by: Peter Chase ]
 
Prakash Chauhan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the deprecated method with respect to line no. Thanks a lot.
 
The only cure for that is hours of television radiation. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic