PDA

Click to See Complete Forum and Search --> : java error


Magnus_Lei
Sep 17th, 2002, 01:55 PM
I am having problems

I am calling a new instance of a class

Payroll employee = new Payroll();

and the classes are in the same directory and everything. I have compiled the Payroll class and it compiles right but then i try to call Exercise which is where the instance Payroll() is and it gives me an error:

cannot resolve symbol.

I have tried putting an import statement in ie. import Payroll.*;
and there is a package Folder statement at the beginning but i can't get it to work.

Whats up?

Magnus_Lei
Sep 17th, 2002, 02:17 PM
It's odd because from with in Forte I do not get this problem...

but when i invoke the javac Employee3.java i get the error.

billrogers
Sep 17th, 2002, 03:06 PM
can you post the exact error you are getting from the compiler?

Magnus_Lei
Sep 17th, 2002, 03:30 PM
How do i print the errors to file from the DOS command line?

I don't think you can?

javac doesn't allow you to. Which sucks if i can say so.

it says.

CountFlips.java:10: cannot resolve symbol
symbol : class Coin
location : class practice.CountFlips
Payroll employee = new Payroll();
^

marnitzg
Sep 17th, 2002, 03:50 PM
If you're binding it to a package then you'll need to put the class in a seperate directory with the package name. Other things to check would be that the spelling is correct, although if you can run it in Forte then it should be correct. What JDK are you using. I don't think anyone can really help without seeing some code/more of the error. What you can also do is press print screen and save the image of the dos box and upload it.