I have this file that contains an instance of some Machine object. When I compile the file I have, it says that the class uses a deprecated API, meaning the Machine object. I tried looking for it in this link, but I find nothing. I was wondering if anyone who used Java for a long time knows whether such a class has actually ever existed or not. I am confused. If you know this class has existed, could you please direct me on where to find it. I can't seem to google for it effectively. any advice is appreciated.

Recommended Answers

All 9 Replies

Do you have the source code for that class?

The file I have is Bio.java, and part of it's code is:

Button submitButton;
    Button resetButton;
    Machine theMachine;
    boolean dateEntered;
    Frame dFrame;

it says that the class uses a deprecated API

Can you post the full text of the error message?

If you don't have the source, can you post the Machine.class file.
There are utilities that can show what classes and methods it uses.
For example, try decompiling it.

I was given Bio.class by a friend. I decompiled it, and saw that it contains a Machine object. I am not sure if the friend would want me to share their code in entirety, although the file is not used for financial purposes or anything like that. However, this is the error message:

----jGRASP exec: javac -g Bio.java

Bio.java:162: cannot find symbol
symbol : class Machine
location: class Bio
Machine theMachine;
Bio.java:23: cannot find symbol
symbol : class Machine
location: class Bio
theMachine = new Machine();
Note: Bio.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.

and these are some methods the Machine class seems to have:

setString(String s)

on one hand, I suspect he must have coded the Machine class, as well. but, I can't see why wouldn't he have e-mail-ed it, and then Java compiler recognizes Machine as a deprecated class, or maybe I am interpreting mistakenly the compiler's complaint?!?!

Note: Bio.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Have you tried the recommendation? using the -Xlint option with javac

I think you may be mis-reading the compiler messages. Class Machine is unknown, so there's no way the compiler would know anything about deprecated anything in that class. The deprecated warning is quite separate, and relates to the Bio class's code so, as Norm says, use Xlint to get the details.
If you don't have the source for Machine do you have a .class file? If so, it's not in your classpath for some reason, if not then you're screwed until you can find a copy.

@James, @Norm,
I compiled with Xlint option. Everything is clearer now. Seems like deprecation complaint has more to do with some parts of the GUI implemented in the file than with Machine file. The error for Machine file is that it's missing, and this seems to have nothing to do with deprecation. thanks a lot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.