Beginner question: cannot resolve symbol, classpath issue?
Hi all,
I am fresh to the java world, so be easy on me. I'm stuck on a very simple problem, i can't find a simple answer. I spent two hours just to figure it out, I've given it up :( . Please help...
So i have my javac and jvm installed in "C:\j2sdk1.4.2_14\bin", I can compile no problem and run my apps ok.
I created a directory in "C:\JavaSandbox" and i can compile fine and run my apps fine.
I created a simple class file named Stapler.java, compiled it successfully and created a class in the "JavaSandbox" directory. Just for the record here is the source code:
*****Stapler.java******
class Stapler{
int stapleamount = 100;
int usestaple =1;
void useStaple (int newValue) {
stapleamount = newValue - usestaple;
}
void printStapleAmounts (int amount) {
System.out.println("There are "+stapleamount+" in the stapler");
}
}
So now in the same 'JavaSandbox' directory I created a class "StapleDemo.java" to call the Stapler.class. Again, here is the source code:
*********StapleDemo.java***********
class StapleDemo {
public static void main(String [] args) {
Stapler Stapler1 = new Stapler();
}
}
I also double checked my CLASSPATH, since from the online searches everyone tells me to check that... Here they are after checking my Windows XP system from cmd C:\ set CLASSPATH command:
C:\j2sdk1.4.2_14\bin; C:\JavaSandbox;
I've been getting errors when I try to compile "StapleDemo.java" here they are:
C:\JavaSandbox>javac StapleDemo.java
StapleDemo.java:6: cannot resolve symbol
symbol : class Stapler
location: class StapleDemo
Stapler Stapler1 = new Stapler();
^
StapleDemo.java:6: cannot resolve symbol
symbol : class Stapler
location: class StapleDemo
Stapler Stapler1 = new Stapler();
^
2 errors

