File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!