Results 1 to 5 of 5

Thread: java error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Posts
    80

    java error

    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?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Posts
    80
    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.

  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    can you post the exact error you are getting from the compiler?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Posts
    80
    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();
    ^

  5. #5
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width