Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javac = "cannot find symbol" when compiling class referencing other classes

843810Feb 8 2008 — edited Dec 17 2009
I have several Java files in a directory which is declared as a package at the start of the files

package filemanager;

This program works perfectly in an IDE, however I'm having problems with compiling in command line.

I have set the classpath as I understand to be right for my computer to:
C:\Program Files\Java\jdk1.6.0_02\bin

I can compile a class that references no other classes in this package/directory.

However files which reference other classes bring up such errors:
javac AllFiles.java
AllFiles.java:174: cannot find symbol
symbol : variable Bob
location : class filesmanager.AllFiles
Bob.getItem(itemRef);

Where Bob is an example of another class. Even though I can say, compile Bob on it's own as it doesnt have any such reference.

I've tried:
javac -cp "C:\Program Files\Java\jdk1.6.0_02\bin" AllFiles.java
This also failed.

Any ideas?

Edited by: ajr87 on Feb 8, 2008 10:26 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 14 2010
Added on Feb 8 2008
7 comments
6,430 views