954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

problem with compiling

hi friends

when i am running my programe on cmd in C:\Programe File\jdk1.6.0_14\bin I got the message that file name.java uses or overrides a deprecated API . Recompile with -Xlint: deprecation for details . what it meant how it will solved . please help me

thanks in advance for reply
shashikant

shashikant.v
Newbie Poster
16 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

by, instead of calling javac <filename> calling javac -Xlint:deprecation <filename> and letting the compiler tell you exactly what it doesn't like. The message, however,is only a warning.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Deprecation warnings are telling you that the API you're calling has been marked as unsuitable for long-term use. Generally, the documentation for that class will tell you what should be used instead--consult the Javadoc for the object you're using in your program and it should shed some light on the matter.

Cronless
Light Poster
29 posts since Sep 2009
Reputation Points: 14
Solved Threads: 2
 

It is just a warning !
http://www.j2ee.me/j2se/1.5.0/docs/api/java/lang/Deprecated.html


use "javac filename.java Xlint:deprecation"

It will tell you which method is deprecated
Search the Java Docs for the better equivalent

topest1
Newbie Poster
19 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

it is a common problem when dealing with applet so you need to create an applet to view the output or if not an applet program look at the compillation options given to you after compilling

josephkn
Newbie Poster
5 posts since Feb 2009
Reputation Points: 11
Solved Threads: 0
 
it is a common problem when dealing with applet so you need to create an applet to view the output or if not an applet program look at the compillation options given to you after compilling

Huh? This is purely a compilation issue. What does applet, or not applet, haveanything to do with it?

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

It is just a warning ! http://www.j2ee.me/j2se/1.5.0/docs/api/java/lang/Deprecated.html

use "javac filename.java Xlint:deprecation"

It will tell you which method is deprecated Search the Java Docs for the better equivalent


dear sir,

I am beginer in java and I am working on a project so that i am unable to solve the deprecation warning. so pls help how that warning will be solved.
pls help me.

thanks for ur reply

shashikant.v
Newbie Poster
16 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

dear sir
thanks for ur reply
i am beginer in java and working on a project , and i am unable to solve the deprecation warning so pls help me how that warning will be solved. if necessary i can forward my code.
pls give reply as soon as possible.
thanks
shashikant

shashikant.v
Newbie Poster
16 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

And have you used that option to javac, yet? Using an option on a command line is not a Java issue, and if you do not know how to provide options and arguments to a command on the command line then you need to learn that, first. And, as said, that is not a Java issue.

If it is that you are using an IDE and don't know how to set the options in the IDE, well, read the user documentation for your IDE and find out how.

Once you have the respective issue corrected, then do that. If you still don't understand what's wrong, then post here what that compilation attempt gave you and we will help you further.

P.S. PM's asking for help are summarily ignored.

Edit: If you simply want the warning to "go away" then use the "@Deprecated" annotation (Google that) or use the "-nowarn" or "-Xlint:none" options to javac.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

It is just a warning ! http://www.j2ee.me/j2se/1.5.0/docs/api/java/lang/Deprecated.html

use "javac filename.java Xlint:deprecation"

It will tell you which method is deprecated Search the Java Docs for the better equivalent

dear sir
i have gone through ur given reply but as a beginer in java i cant able to solve the problem of deprecation. so pls help me how the problem will be solved.
thanks
shashikant

shashikant.v
Newbie Poster
16 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

And have you used that option to javac, yet? Using an option on a command line is not a Java issue, and if you do not know how to provide options and arguments to a command on the command line then you need to learn that, first. And, as said, that is not a Java issue.

If it is that you are using an IDE and don't know how to set the options in the IDE, well, read the user documentation for your IDE and find out how.

Once you have the respective issue corrected, then do that. If you still don't understand what's wrong, then post here what that compilation attempt gave you and we will help you further.

P.S. PM's asking for help are summarily ignored.

Edit: If you simply want the warning to "go away" then use the "@Deprecated" annotation (Google that) or use the "-nowarn" or "-Xlint:none" options to javac.

dear sir

i have eneterd the following on command prompt :
javac filename.java
but it is giving deprecated warning. for the overcome of deprecated warning where my code is deprecated i had given the following command
javac -Xlint deprecated file name.java
after putting the command 2 step were shown where the method is deprecated. but i am not able to solve the deprecated problem.
so pls help how it is solved.
if necessary i can forward my code to u .
thanks
shashikant

shashikant.v
Newbie Poster
16 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

So, as I said, post what it was you got.

P.S. You hopefully did not actually type
javac -Xlint deprecated file name.java
but rather javac -Xlint:deprecation filename.java
which is what the initial message said (for the option) and only common sense (for the argument) besides the fact that I had alreadyexplicitly posted that.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
dear sir i have gone through ur given reply but as a beginer in java i cant able to solve the problem of deprecation. so pls help me how the problem will be solved. thanks shashikant


It seems that you have not yet tried

"javac filename.java Xlint:deprecation"

method

try this or else
Post your code !

topest1
Newbie Poster
19 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

It seems that you have not yet tried

"javac filename.java Xlint:deprecation"

method

try this or else Post your code !

You have it wrong, though. See above.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

And have you used that option to javac, yet? Using an option on a command line is not a Java issue, and if you do not know how to provide options and arguments to a command on the command line then you need to learn that, first. And, as said, that is not a Java issue.

If it is that you are using an IDE and don't know how to set the options in the IDE, well, read the user documentation for your IDE and find out how.

Once you have the respective issue corrected, then do that. If you still don't understand what's wrong, then post here what that compilation attempt gave you and we will help you further.

P.S. PM's asking for help are summarily ignored.

Edit: If you simply want the warning to "go away" then use the "@Deprecated" annotation (Google that) or use the "-nowarn" or "-Xlint:none" options to javac.

So, as I said, post what it was you got.

P.S. You hopefully did not actually type javac -Xlint deprecated file name.java but rather javac -Xlint:deprecation filename.java which is what the initial message said (for the option) and only common sense (for the argument) besides the fact that I had alreadyexplicitly posted that.

sir
sorry for wrong sentence.
after wriitnig the javac -Xlint:deprecation filename.java i got the warning
"[deprecation] show() in java.awt.Dialog has been deprecated fd.show()"
in open and save dialog box.
pls reply as soon as possible.

shashikant.v
Newbie Poster
16 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 
You have it wrong, though. See above.


oh! sorry,

I forgot to put - sign before Xlint:deprecation

use:
"javac filename.java -Xlint:deprecation"

Thanx for pointing out my mistake !

topest1
Newbie Poster
19 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

oh! sorry,

I forgot to put - sign before Xlint:deprecation

use: "javac filename.java -Xlint:deprecation"

Thanx for pointing out my mistake !

You also have the option in the wrong position relative to the filename list. Thatis rather important.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
sir sorry for wrong sentence. after wriitnig the javac -Xlint:deprecation filename.java i got the warning "[deprecation] show() in java.awt.Dialog has been deprecated fd.show()" in open and save dialog box. pls reply as soon as possible.


use

fd.setVisible(true);


instead of fd.show();

topest1
Newbie Poster
19 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 
sir sorry for wrong sentence. after wriitnig the javac -Xlint:deprecation filename.java i got the warning "[deprecation] show() in java.awt.Dialog has been deprecated fd.show()" in open and save dialog box. pls reply as soon as possible.

Okay. And have you looked at the API docs for Dialog to see if that method description suggests a solution?

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
You also have the option in the wrong position relative to the filename list. That is rather important.

You are write
But this also works fine

i have tried this !

topest1
Newbie Poster
19 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You