• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cannot resolve symbol

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic