The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

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