• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot resolve symbol

 
Mulugeta Maru
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message I am getting is that of cannot resolve symbol. I have to class as show below and when I try to compile ClickMe.java I get the error message:

clickme.java:6: cannot resolve symbol
symbol : class Spot
location: class ClickMe
private Spot spot = null;

clickme.java:28: cannot resolve symbol
symbol : class Spot
location: class ClickMe
spot = new Spot(RADIUS)
2 errors





Please note that I have no problem compiling a single class i.e. a class that does not refere to another class.

It is my understanding that when I compile ClickMe it automatically compiles Spot.

Thank you for you help.

Maru
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's most likely a classpath issue. It looks like you're not putting these classes in a package, so it should be as simple as making sure that the current directory (".") is part of the class path. Then you do the compile (javac) and execute (java) commands in the directory where the source is located.

You can add "." to the classpath as part of the environment, or you can explicitly specify it using the "-cp" or "-classpath" flags.

There are thousands of web sites where you can get details on how to set up the classpath, and I'm sure there is a link here at JavaRanch that describes it as well. I'll see if I can find a good one and add it to this post.

ADDED: Try this ... How to set the ClassPath
[ May 24, 2004: Message edited by: Wayne L Johnson ]
 
Mulugeta Maru
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure my CLASSPATH is properly set.

 
Mulugeta Maru
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is a CLASSPATH problem.I made changes to the CLASSPATH and it now works perfectly.

Thank you for your kind help.

Maru
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic