• Post Reply Bookmark Topic Watch Topic
  • New Topic

symbol error...HELP!  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am new to programming and programming with JAVA and am using a SAMS teach yourself JAVA book. I am currently stuck trying to compile an application. I thought it may have been due to me inputting it incorrectly so I went on to the support website (javain21days.com) and copied and pasted the code directly from there and still got the same error messages:-





The error messages I get are:-

VolcanoApplication.java:3: cannot find symbol
symbol : class VolcanoRobot
location: class VolcanoApplication
VolcanoRobot dante = new VolcanoRobot();


VolcanoApplication.java:3: cannot find symbol
symbol : class VolcanoRobot
location: class VolcanoApplication
VolcanoRobot dante = new VolcanoRobot();


Any help on this issue would be so much appreciated I can't even begin to tell you!! I've been staring blankly at my monitor for about 2 days now trying to figure this out. I'm guessing to someone with experience this problen will be a simple fix!

Thanks,

Graeme



[HENRY: Added code tags]
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Basically, you don't have the complete code. Your VolcanoApplication class that you are trying to compile, depends on the VolcanoRobot class, which the compiler can't find. You need to get that source and compile it too.

Henry
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
welcome to JavaRanch
please use code tag to post your code. so that your code can be easy to read .
 
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check that book, there should be another one class with the name VolcanoRobot.

And, UseCodeTags When you post codes.
 
Graeme Wicks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Thanks for the really quick replys!! I have compiled the 'VolcanoClass' src code but I am still getting the same error messages when I try and complile the 'VolcanoApplication' src code, could there be something more fundementally wrong?

Thank you for your replys, I really do appreciate any help and feedback. Also I will use CodeTags in the future.

Graeme.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Graeme Wicks wrote:Hey,

Thanks for the really quick replys!! I have compiled the 'VolcanoClass' src code but I am still getting the same error messages when I try and complile the 'VolcanoApplication' src code, could there be something more fundementally wrong?

Thank you for your replys, I really do appreciate any help and feedback. Also I will use CodeTags in the future.

Graeme.


Did you go through the thread? you should have another class called VolcanoRobot, otherwise it won't compile! Do you have it?
 
Graeme Wicks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Abimaran

Yes, sorry on my last post I wrote it wrong. I have the VolcanoRobot src code which I have indeed compiled so now have the VolcanoRobot.class but when trying to compile the VolcanoApplication I still get the same error messages. Any thoughts to what I could be doing wrong? Like I said on my original post I am very new to this so it will definitley be something that I am doing wrong.

Again any help is appreciated,

Cheers,

Graeme
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do you have a CLASSPATH environment variable set? And if so, what is it set to?

Can you give us the exact command that you used to compile?

Can you do a directory listing, and confirm that the other class file exists?

Henry
 
Graeme Wicks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Henry,

My CLASSPATH setting is> C:\Program Files\Java\jdk1.6.0_21\lib

The source code for the VolcanoApplication is:-





I did a DIR check and the VolcanoRobot Class is there:-

23/07/2010 12:30 PM <DIR> .
23/07/2010 12:30 PM <DIR> ..
19/07/2010 09:56 PM 416 Apples.class
19/07/2010 09:38 PM 280 HelloUser.java.txt
23/07/2010 11:04 AM 639 VolcanoApplication.java
23/07/2010 12:30 PM 1,009 VolcanoRobot.class
23/07/2010 12:29 PM 430 VolcanoRobot.java
19/07/2010 09:54 PM 144 work.java
6 File(s) 2,918 bytes
2 Dir(s) 92,275,441,664 bytes free


I hope this can help....

Thank you,

Graeme

 
Marshal
Posts: 56606
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would do well to delete that CLASSPATH altogether. It is misleading your compiler altogether, since there is no VolcanoRobot in /lib. Also it is unnecessary to include /lib in the classpath, since the JDK automatically checks for classes there anyway.

If you can't delete that CLASSPATH altogether, change it to .;

Yes, that's a dot and semicolon, which means "current directory." Then the JDK will start looking for classes in the "current directory", which is presumably where your VolcanoRobot is to be found.

I presume there are no package names in any of these classes?
 
Graeme Wicks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ritchie,

I just changed the CLASSPATH to a dot and semicolon and tried to compile the VolcanoApplication src code again.....It worked
Thank you for guiding a newbie like me in the right direction!!! Now back to the book!!!

Also thanks for everbody elses feedback!!! You're all legends.

Have a good day people.

Thanks,

Graeme.
 
Campbell Ritchie
Marshal
Posts: 56606
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome and well done By the way, where did it tell you to set up that classpath in the first place?
 
Graeme Wicks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

When I was first configuring the JDK I was having trouble compling my first program (Hello World) and In the Appendix at the back of the book it mentioned that you may need to set your CLASSPATH to the following:-

"for example, if you installed the kit (JDK) in c:\Program Files\Java\jdk1.6.0, your Classpath should contain the following:-

.;C:\"Program Files"\Java\jdk1.6.0\lib\tools.jar"

To be honest I feel it's mainly myself Misinterpreting the data, like I said I am very new to this and perseverance is key at the beginning of any new subject you are trying to learn. The main thing is due to your help and the others I can continue learning! When I encountered the problem I was frustrated as I was just starting to get into the flow and felt like I was understanding the beginning concepts.... now I can continue!

Again, Thanks for your help.

Graeme
 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the VolcanoRobot class? Without that this code wont compile. Also import the class VolcanoRobot in the your code, if that is in another folder!
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now where did these above few posts come from???

When i was posting they were not there!! Looks like the problem is solved!!
 
Campbell Ritchie
Marshal
Posts: 56606
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somnath Mallick wrote:Now where did these above few posts come from??? . . .

When i was posting they were not there!! . . .
We remotely changed your timezone so we could have an hour to post things while you thought nothing was happening Mwaaahaaahaaahaaahaaa!
 
Campbell Ritchie
Marshal
Posts: 56606
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bit about adding the toolkit to the CLASSPATH is incorrect; that has not been necessary for about ten years. I now dislike that SAMS book even more than I used to

You will however notice the recommended setting contains .; which is hard to see, and which you would appear to have overlooked when you first set your CLASSPATH.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Graeme Wicks wrote:Hey Abimaran

Yes, sorry on my last post I wrote it wrong.


No need of sorry here, and it is solved. OK?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!