File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes cannot resolve symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot resolve symbol" Watch "cannot resolve symbol" New topic
Author

cannot resolve symbol

Mulugeta Maru
Ranch Hand

Joined: Jan 20, 2003
Posts: 68
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

Joined: Sep 03, 2003
Posts: 399
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

Joined: Jan 20, 2003
Posts: 68
I am not sure my CLASSPATH is properly set.

Mulugeta Maru
Ranch Hand

Joined: Jan 20, 2003
Posts: 68
Yes it is a CLASSPATH problem.I made changes to the CLASSPATH and it now works perfectly.

Thank you for your kind help.

Maru
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: cannot resolve symbol