• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Need help with Java, cannot find symbol class?  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The program is an Address Book. and I cant get rid of the "cannot find symbol class" error, what should I do?

here is the code:



Here is the error:
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compiler does not find the AddressBookEntry class because it's not in the CLASSPATH
1. Where is AddressBookEntry.class ?
2. How did you compile AddressBook ?
 
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your AddressBookEntry class in the same package as the AddressBook class? If not, you need to import it.
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohh.. Beaten by 11 seconds...!!!
Christophe Verré, I'm sure your network is faster than mine.
 
beu curt
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Christophe Verré wrote:The compiler does not find the AddressBookEntry class because it's not in the CLASSPATH
1. Where is AddressBookEntry.class ?
2. How did you compile AddressBook ?



A big noob here, can't understand what you are trying to explain.
sorry
 
Marshal
Posts: 60802
190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please find the class whose name you are getting the problems with, and tell us exactly where you have got the .class file.
 
beu curt
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Please find the class whose name you are getting the problems with, and tell us exactly where you have got the .class file.



This is the whole program. I posted everything.

I think the problem is line number 8:

 
Saloon Keeper
Posts: 1917
55
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well...

Take a look at the program written...

it requires two different classes : AddressBook and AddressBookEntry

You have provided code that shows the defination of AddressBook,
but where is AddressBookEntry ?
thats what the java compiler is saying:

"cannot find symbol class AddressBookEntry"

let me rephrase/interpret that:

"Dude, I want to run your program, but I am unable to find a class named 'AddressBookEntry'. Its probably in a file called AddressBookEntry.java,
have you forgotten to define such class? if you have defined it, is it in the same class path so that I may access it ?"



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!