This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Junit and ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Junit and ant " Watch "Junit and ant " New topic

Junit and ant

pradeep selvaraj
Ranch Hand

Joined: Nov 29, 2005
Posts: 62
I want to integrate JUnit into my ant. This is my dir structure.

-src (all my source files)
-lib (contains junit and other jar files)
-test (all my test files)
-dist (where all the class files are placed by ant)

This is what i had done, but i get a big error saying that it cannot recognise <Junit> tag itself(i think it has something to do with classpath).

I am not sure where i go wrong. Please help.


[<a href="" target="_blank" rel="nofollow">CyVis - Software Complexity Visualiser</a>] [<a href="" target="_blank" rel="nofollow">Pradeep's Blog</a>]
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

If 'junit' is not known it sounds like you need to downloas and install (ie drop in the ant/lib dir) the optional junit tasks. I'm not exactly sure, but it should be included in the downloads from

I agree. Here's the link:
subject: Junit and ant
jQuery in Action, 3rd edition