posted 16 years ago
Pramod,
First things first.. PATH and CLASSPATH are different and you got to mention it as CLASSPATH , when you mean CLASSPATH.Secondly when you use -classpath option , it means you are overiding your CLASSPATH value sent in your environment.
So , in the first case it worked because your class lies in the present working directory (pwd) and your -classpath option says "." , which means look for classes only pwd.
In next case , you have not specified so it uses the CLASSPATH value defined in the environment. But your CLASSPATH should either have complete path where Test.class lies or the "." in order for it to find the class. So make sure you add "." to your CLASSPATH variable as well.