You need to put the JUnit's junit.jar in either Ant's lib directory or
specifiy this in your CLASSPATH variable in order to get this to work.
Will
Alexander Woodroffe wrote:
>
> Hi All
>
> I am a new to Ant and relativley new to Java, and I have been
> experiencing a few problems with the JUnit optional task. I have upto now
> been using Ant 1.2 with the current optional jar along with JUnit3.5 to run
> my Unit tests.
> However I would now like to move to Ant 1.3 so that I can make use of some
> of the new optional tasks. The problem is that I get a class definition
> exception. I'm a bit lost at this, as ant managed to locate the actual JUnit
> task in the optional jar which is in the same package.
>
> compile-test:
>
> test:
> [junit] Running com.netdecisions.frameworks.AllTests
> [junit] java.lang.NoClassDefFoundError:
> org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner
> [junit] TEST com.netdecisions.frameworks.AllTests FAILED
>
> BUILD SUCCESSFUL
>
> Thanks in advance Alex
>