The classpath problem  

Posted by shashank in

July 8, 2009
The same image can be seen in detail at:


When I instruct to compile the program into the adat folder, the class files are created. From being anywhere in the directory - true at least for the cases I have tried yet - I can execute the program with the instruction:
>java -cp C:\jtemp\adat MyPack.AccountBalance

But when I go to the actual location the following command fails to execute:
C:\jtemp\adat>java MyPack.AccountBalance

and yields a "NoClassDefFoundError".

The conclusion I have derived from this is that the "classpath" variable is locked by default and hence the programs don't execute unless the same is explicitly changed. Perhaps such a conclusion is wrong, but at present it enables me to execute the simple programs I am writing.

This entry was posted on Wednesday, July 8, 2009 at 5:57 PM and is filed under . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment