Can some one kindly help me with this problem ?
Contents of GoDeep.java and Foo.java
I compiled GoDeep.java successfully using the javac command from current folder "x": javac -cp test\MyJar.jar GoDeep.java.
However when I try to execute the class file using java -classpath .:test/MyJar.jar GoDeep from current folder"x", a NoClassDefFoundError exception is generated. Why is this happening?
Joined: Jul 06, 2010
It was a mistake from my part. I was executing my java programs in Linux but recently I started executing it in Windows 7 and I forgot about changing the separator character for directories from : to ;. The execution of class file works fine after changing the java command to
java -cp .;test\MyJar.jar GoDeep.
subject: Doubt: Qn 12 from K&B SCJP 6.0 chapter Development