Jimbo (2) [Avatar] Offline
#1
Hi,

I'm sure I'm doing something wrong (os=win/xp), but the line of code below gives me the error indicated. Both the junit.jar and the TestCalculator.class file are in the directory indicated below.

D:JavaeclipseworkspaceTestCalcin>java -cp .; junit.jar junit.swingui.TestRunner TestCalculator

Exception in thread "main" java.lang.NoClassDefFoundError: junit/jar

I'm not sure why Java can't find the class file.

If I remove the "." in the java command, then I do see the JUnit Swing frame, but it still doesn't see the class even if I hard code a full path.

Any ideas????

Thanks.
Jimbo (2) [Avatar] Offline
#2
Re: Page 15 -- Can't get basic code to work
Never mind. My problem was I need to have the .java files in the same directory.

All is working fine now.
vmassol (51) [Avatar] Offline
#3
Re: Page 15 -- Can't get basic code to work
Hi Jimbo,

I've just realized I had not answered you. Somehow the watch seems to have failed to notify me of a post. I'm trying to answer to all questions.

Glad you have your answer. Thanks for posting back.
vmassol (51) [Avatar] Offline
#4
Re: Page 15 -- Can't get basic code to work
ooopsss. Just realized that your 2 posts were posted very close to eather other and I've just found your previous post in my inbox...

smilie