Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

cannot resolve symbol

 
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
 
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
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic