| Author |
Deprecation compile option ????
|
Shara Woods
Greenhorn
Joined: Jul 06, 2004
Posts: 4
|
|
For a project i work on when i say make -f makefile I get the following error. 6 files use or override a deprecated API. Recompile with "-deprecation" for details. Can somone please explain how to use this on command line?
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
|
javac -deprecation Foo.java
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Mahesh Bhatt
Ranch Hand
Joined: Sep 15, 2004
Posts: 88
|
|
hi in the newer versions of java some methods have been deprecated . so if u want to compile that file u should use javac -deprecation <filename.java> . this would reduce the error to a warning . and u can easily run the program.
|
Impossible is I M Possible
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
Let's be clear about something. Compiling code that uses a deprecated method, without specifying the -deprecation switch, the compiler generates a warning - not an error - letting you know that a deprecated API was used by the just-compiled source code. Compiling code that uses a deprecated method, while specifying the -deprecation switch*, generates a more detailed warning message, lising the line of code where the deprecated API was used. In no case does using a deprecated API cause code to not be compiled. * Note: With Java 2 v5, the compiler suggests using -XLint:deprecation switch. [ September 17, 2004: Message edited by: Dirk Schreckmann ]
|
 |
 |
|
|
subject: Deprecation compile option ????
|
|
|