Using JUnit4 with Ant ===================== One of the common use case for JUnit is using it with Ant build system, as part of the build process of your source code. Explanation ------------ To launch some JUnit4 TestCase from Ant, you need "ant" and "junit4" packages. You also need to add junit4.jar in nested of your targets. There is no need to add it in CLASSPATH or to ANT_HOME/lib [1]. [1] "As of Ant 1.7 no longer requires you to have junit.jar in Ant's start-up classpath" "For example, as of Ant 1.7.0 you can run the task without junit.jar in Ant's own classpath, so long as it is included (along with your program and tests) in the classpath passed when running the task. Where possible, this option is generally to be preferred, as the Ant script itself can determine the best path to load the library from" This strategy also prevent unwanted clash with junit 3.x : you can launch multiple junit target, each with its own classpath. For detailed history, you could see #512530 and #543327 in Debian BTS. Sample ------ Here is a Ant snippet for JUnit4 usage : ---------------------------------------------------------------- ----------------------------------------------------------------