The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Try this

Posted by shailesh on November 26, 2000 at 5:51 AM

> I am reading book <>, and found it very good. I am a beginner for Java, and just began to learn it.

> I meet a problem when I read chapter 5 about package:
> I do as your instructions,set the classpath,make the directory for the tools package, and compiled the and, it reports none error,but when I run TestAssert, it tells me
> 'Exception in thread "main" java.lang.NoClassDefFoundError: TestAssert'.
> And I found TestTool for test P.class has this matter, too.
> I am hardly going on if I don't get rid of the problem, can you do me a favor to this matter?
> Thanks

u must write throws Exception at the end of your main method.


public static void main(String args[]) throws Exception

This is because u r telling compiler to handle the Exceptions since the user is not handling the xceptions.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us