I was practicing this package example from "java2 complete refrence"
package cert.java;
class Balance
{
String name;
double bal;
Balance( String n, double b )
{
name = n;
bal = b;
}
void show()
{
if( bal > 0 )
{
System.out.println("--->");
System.out.println(name + " :$" + bal);
}
}
}
class AccountBalance
{
public static void main(String args[])
{
Balance current[] = new Balance[3];
current[0] = new Balance("prahant" , 4000);
current[1] = new Balance("chaita" , 5000);
current[2] = new Balance("usha" , 6000);
for(int i = 0; i < 3; i++)<br /> {<br /> current[i].show();<br /> }<br /> }<br /> }<br /> <br /> I have a directory in my C: named c:\cert\java; the source and class files are included in the <br /> same directory but when i try to execute the class file using <br /> 1) C:\cert>
java java.AccountBalance -- as described by "patrick" go one level up and execute
the class file.
2) c:\cert\java> java.AccountBalance.-- give the same exception noclassdeffounderror.
now i even tried setting the classpath variable to
set classpath=C:\cert\java; C:\jdk1.2.2\lib\tools.jar; C:\jdk1.2.2\lib\dt.jar;
this is silly but do i have to specify the jdk path
Please explain me why the classpath is classes the classpath "variable"