Thanks, Stefan. I understand the problem now. > You must have junit.jar and the junit task in the same classpath, > either (1) both in CLASSPATH or ANT_HOME/lib or (2) none of them.
Okay, so can you put a note to that effect into junit.html? Something really clear like, Note: If you have optional.jar in ANT_HOME/lib (or your CLASSPATH), then you must put junit.jar in ANT_HOME/lib (or your CLASSPATH) as well. See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6606 for a full description of this issue, and alternate workarounds for it. Or better yet, add an exception handler to Ant that checks for the particular exception (ClassNotFound?) when loading a task from optional.jar, and prints a more descriptive error message. Right now it says Could not create task of type: junit. Common solutions are to use taskdef to declare your task, or, if this is an optional task, to put the optional.jar in the lib directory of your ant installation (ANT_HOME). which may be technically accurate, but doesn't really help newbies solve the problem, since optional.jar *is* in the lib directory. Another option is to bundle JUnit itself inside optional.jar. It's about 122K, but could get a lot smaller if the GUI is removed. I'm not sure if the licenses are compatible, but I have a feeling you can make it work. Obviously, this opens a can of worms wrt upgrading JUnit versions, but I thought I'd mention it. - A On Wed, Mar 13, 2002 at 05:21:02PM +0100, Stefan Bodewig wrote: > On Wed, 13 Mar 2002, <[EMAIL PROTECTED]> wrote: > > > <p>Note: In order to use this task, you must place > > <code>junit.jar</code> in your <code>$ANT_HOME/lib</code> > > directory.</p> > > This is not strictly true. The full truth is: > > You must have junit.jar and the junit task in the same classpath, > either (1) both in CLASSPATH or ANT_HOME/lib or (2) none of them. > > See <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6606> for > details. > > Stefan > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- Alex Chaffee mailto:[EMAIL PROTECTED] jGuru - Java News and FAQs http://www.jguru.com/alex/ Creator of Gamelan http://www.gamelan.com/ Founder of Purple Technology http://www.purpletech.com/ Curator of Stinky Art Collective http://www.stinky.com/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
