• Post Reply Bookmark Topic Watch Topic
  • New Topic

file compileproblem  RSS feed

 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i cannot figure out why the following wont compile

its giving the following error
[CODE] ADogsLife.java:3: cannot resolve symbol
symbol : class Dog
location: class ADogsLife
Dog dog = new Dog();
^
ADogsLife.java:3: cannot resolve symbol
symbol : class Dog
location: class ADogsLife
Dog dog = new Dog();CODE]
as i'm creatign a user defined instance of dog and creating an instacne of it i cant see the problem ?
any ideas ?
cheers
chris
 
Jason Fox
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is Dog? Is it a class that is visible to ADogsLife? It seems the compiler cannot find Dog, or Dog is not visible to ADogsLife.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks fine -- given that there's a class Dog somewhere the compiler will be able to find it. This is probably just a CLASSPATH issue. See the JavaRanch FAQ on this topic. If that doesn't help you get things working, then c'mon back here and tell us where the various relevant files and directories are, what your compiler command line is, what CLASSPATH settings you've tried, etc.
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, im trying the following and its not working - i dont see any point in setting it within the envornment variable classpath as i'm just running through examples, and running them from the prompt



cheers

chris
 
Richard Bradford
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try compiling using the following:

javac -classpath "C:\tomcat 4.1\webapps\test" ADogsLife.java
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers it worked.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!