compiler cannot find other files
Ok, whenever I try to compile any file the references another file I've written it tells me that it "cannot find symbol". Everything is correct as I can compile just fine on other computers that have java installed on them, but this one seems to hate it for some reason. I have a windows xp machine with an intel processor, and I have the latest version of java 1.5.0_06. Anyone have any ideas what could be causing this to happen? Thanks for your help.
[461 byte] By [
Arbutosa] at [2007-10-2 14:01:14]

Post the detail error messages, commands, and directories involved.Cut and paste information, don't retype.
Here is the compile error
"CampStore.java:5: cannot find symbol
symbol : class CampStoreGUI
location: class CampStore
CampStoreGUI gui = new CampStoreGUI(); "
CampStore and CampStoreGUI are in the same file, and CampStoreGUI class is compiled and as stated before, the entire program compiles on other PCs. The path name to javac.exe is C:\Program Files\Java\jdk1.5.0_06\bin. This may be helpful:
"C:\Documents and Settings\Bryn Robbins\My Documents\Brent\Java\campStore>javac CampStore.java -verbose
[parsing started CampStore.java]
[parsing completed 50ms]
[search path for source files: []]
[search path for class files: [C:\Program Files\Java\jdk1.5.0_06\jre\lib\rt.jar,
C:\Program Files\Java\jdk1.5.0_06\jre\lib\jsse.jar, C:\Program Files\Java\jdk1.
5.0_06\jre\lib\jce.jar, C:\Program Files\Java\jdk1.5.0_06\jre\lib\charsets.jar,
C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext\dnsns.jar, C:\Program Files\Java\j
dk1.5.0_06\jre\lib\ext\localedata.jar, C:\Program Files\Java\jdk1.5.0_06\jre\lib
\ext\sunjce_provider.jar, C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext\sunpkcs1
1.jar]]
[loading C:\Program Files\Java\jdk1.5.0_06\jre\lib\rt.jar(java/lang/Object.class
)]
[loading C:\Program Files\Java\jdk1.5.0_06\jre\lib\rt.jar(java/lang/String.class
)]
[checking CampStore]
CampStore.java:5: cannot find symbol
symbol : class CampStoreGUI
location: class CampStore
CampStoreGUI gui = new CampStoreGUI();
^
CampStore.java:5: cannot find symbol
symbol : class CampStoreGUI
location: class CampStore
CampStoreGUI gui = new CampStoreGUI();
^
[total 340ms]
2 errors".
i have the same problem, i think its gotta do with a change in your system since reinstalling java doesn't work at all. even with super simple classes it still messes things up:
A.java:
public class A
{
public A()
{
new B();
}
public static void main(String[] args)
{
new A();
}
}
B.java:
class B
{
};
my verbose:
[parsing started A.java]
[parsing completed 219ms]
[loading c:\j2sdk1.4.2_05\jre\lib\rt.jar(java/awt/Graphics.class)]
[loading c:\j2sdk1.4.2_05\jre\lib\rt.jar(java/awt/Image.class)]
[loading c:\j2sdk1.4.2_05\jre\lib\rt.jar(javax/swing/JFrame.class)]
[loading c:\j2sdk1.4.2_05\jre\lib\rt.jar(java/lang/Object.class)]
[loading c:\j2sdk1.4.2_05\jre\lib\rt.jar(java/lang/String.class)]
[checking A]
A.java:10: cannot resolve symbol
symbol : class B
location: class A
new B();
^
[total 1641ms]
1 error
i had this before and a format+windows reinstall solved it, but hell nobody wants to do that for something like this
its allmost if something messed with a setting reg key from java or something like that.
aiona at 2007-7-13 12:08:13 >

Yeah, your right, nobody really wants to reinstal windows. That made me remember something though. As far as I can remember this issue started for me after updating my version of java. The first instal of java I had worked fine, and after I installed another version things stoped working.
@ arbutos
Your classpath environment variable is not set correctly - the information you posted indicates that it is set to an empty value.
You said that the CampStore.java file contains both CampStore and CampStoreGUI classes, right? If so, change to the directory that contains the CampStore.java file (I assume that it's C:\Documents and Settings\Bryn Robbins\My Documents\Brent\Java\campStore) and issue this command:
javac -cp . CampStore.java
IMPORTANT: include the period and surrounding spaces
In this instance, java starts to compile the CampStore class and finds that it need to first compile the CampStoreGUI class. It uses the classpath to try to find it, but fails.
Thank you. I had tried something similar to that, I did -classpath and the full path of where the folder was, maybe I made a typo or something of that nature. Still have to wonder why java is not checking the folder for the other files, but I can get it to work. Thanks again.
> Still have to wonder why java is not checking the folder for the other filesBecause it looks where you tell it to, using the value you set for the classpath variable - and the current directory was not listed (actually nothing was).
Hi.
Have you had any luck with this problem?
I am getting exactly the same problem where the javac compiler can not find any of the classes in the same directory. I am also using Windows XP.
I reinstalled JDK 1.6 and compiled from the bin directory on my XP machine but this did not solve the problem. I have already successfully compiled the exact same .java files on my computer in work which is running Windows 2000. Could the problem be with XP?
Cheers