Question:
Everything I try to run in java says it overrides a deprecated API and to run with -Xlint. How do I do this? ?
rivaloflogic
2008-12-05 05:40:58 UTC
Ok, so I'm new to the whole Java idea, but as i'm compiling programs it comes up with this error. " (Whatever the file name is) uses or overrides a deprecated API. Recompile with -Xlint: Deprecation for details." Why is it saying this and what do I need to do to recompile correctly so my programs will run?
Three answers:
lansingstudent09101
2008-12-05 05:52:23 UTC
Probably because you're overriding a deprecated API...



It means that your program declares functions with the same name as functions in classes that you're working with that it inherited from.



A little source example would go a long way here. Usually when you're looking for help with problems like this (programming). It's best to include an SSCE (Short Self-contained Compilable Example) that demonstrates the problem.
anonymous
2008-12-06 04:26:20 UTC
This means that you are using some kind of feature in Java that the developers have decided to mark as deprecated because of a new feature that does the same thing or does it better. This error doesn't actually affect the compilation, you can continue to compile and run the program even though this error pops up. It's generally bad practice to use deprecated objects or methods because they may lose functionality as Java keeps getting updated, but if you are working on something simple, you can just ignore this error.
Germann A
2008-12-05 13:54:35 UTC
Read the [on-line] docs for the class/method in question, there will be suggestions about new methods to use...


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...