-
-deprecation help
when i compile my code, it says tool completed successfully along with another message, i tried to run my applet but it wont load.
this is what it says when i compile the code:
Note: C:\Documents and Settings\Desktop\Dijkstra's Algorithm\GraphAlgorithm.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
Tool completed successfully
what is a deprecated API and how do i get round this??
i'm using Textpad if that helps.
-
"deprecated" means that the method you are attempting to use used to be a valid one, but Sun have decided to replace it with a different method for one reason or another. If you go to Sun's website and read the API for the method or class you're attempting to use it will tell you which method has replaced it. Go to google and search, Sun's API is usually the first link it suggests i've found.
-
you should avoid using deprecated APIs because they may disappear from the spec without warning, leaving you witha non-working program. to get information about what exactly it is youre using, that is deprecated, do:
javac -deprecation GraphAlgorithm.java
here is what happened when i threw a Thread.stop() method into a test class:
Yalla.java:115: non-static method stop() cannot be referenced from a static context
Thread.stop();
^
Yalla.java:115: warning: stop() in java.lang.Thread has been deprecated
Thread.stop();
^
1 error
1 warning
So i now know that stop() has been deprecated, and what class it is in. I can go to java.sun.com api and look at how i should do things now..
-
how do i do:
javac -deprecation GraphAlgorithm.java
using textpad?
-
ha ha.. okay
first, i would nip over to www.ultraedit.com and get a real text editor.. its more configurable than textpad (i installed textpad just to have a look, and check that i wasnt being overly cruel..)
with your existing textpad you can switch on deprecation by merely editing the preferences... at the bottom of the prefs/config screen, in the list on the left if a [+] Tools icon. click the [+]
in the Compile java item that has appeared, change the contents of the filename box (from to):
$File
-deprecation $File
but, like i say.. i recommend ultraedit more strongly..
-
What is it that you think textpad is missing? It's what I always use and haven't had any problems with it, but since it's all i've ever used maybe i'm missing out on something and don't even realise it
-
actually, i may have been a little harsh on TextPad.. ive looked at nearly every menu function, and it's more or less the same as UltraEdit, certainly better value for money if you are buying it 
There are a few UE finctions that I cannot see in textpad, that I use quite frequently:
reindenting entire files
sorting file contents
rectangluar selection of file data (similar to dos)
replace in files
match brace (it's more clear in UE; it selects the entire region, TP skips around)
docking of some windows (like tool output)
im sure if i had to use textpad, and ue was not available, i wouldnt have too much of a problem with it - it's sure done a lot since i last looked at it (and it seems geared to users of the more vile unix editors, vi, vim etc...)
note; the tool configuration in some regards is a lot better than UE's, in that you can specify a regexp to match the output.. im not sure where UE is configured to do this..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks