Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

alej.java uses or overrides a deprecated API

  Asked By: Pamela    Date: Jun 16    Category: Java    Views: 10744
  

I`m trying to compile a little code but dont know why I get the
following:
"Note: C:\Temp\aleja\new\UDPClient.java uses or overrides a
deprecated API.
Note: Recompile with -deprecation for details."
Could someone please tell me what it means & why is happening?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Ryan Evans     Answered On: Jun 16


Inside your class you are making some sort of call that is classified as
deprecated  command. I prime example of a deprecated command is the
Thread.stop() (and a host of other Thread messages).

Deprecation is a function or class that is going to be removed from Java
at some point in the future. Deprecation happens when it is discovered
after the fact that the concept behind an idea (like Thread.stop) isn't
the best idea in the world and a new idea that works in a different way
takes over.

A decent IDE should be able to warn you about deprecated commands, and
show you where they are

 
Answer #2    Answered By: Aamanee Khan     Answered On: Jun 16

it is saying that, in win, you compile  your program by

%javahome%\bin\javac -classpath . -deprecation UDPClient.java

to get a more detailed message on what deprecated  thing you
are using and where.

 
Answer #3    Answered By: Michele Grant     Answered On: Jun 16

it's not an error it's just a warning message stating that you are using an
obsolete (out of date) method in your program

if you are giving the following syntax to compile  your program compiler will
let you know what are the obsolete methods you are using in your program.

javac -deprecation <source_file_name.java>

 
Answer #4    Answered By: Aberto Rossi     Answered On: Jun 16

I just got on count that I needed to give some data to the program in
the command line, something like:
UDPClient 7 message
and since I use JCreator and doesnt let me do it when trying to run
it after compile, it throw that message (when compile),
which is as you said, is not an error.
When I got everything right then I think didn`t need your answers,
but I learn what deprecation means  and now I know now the command to
see everything explain

 
Didn't find what you were looking for? Find more on alej.java uses or overrides a deprecated API Or get search suggestion and latest updates.




Tagged: