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 Ant tool? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant tool?" Watch "Ant tool?" New topic

Ant tool?

Charlie Swanson
Ranch Hand

Joined: Jan 29, 2001
Posts: 213
I am just getting started with J2EE. I am using something called Ant. I have the path set up to find the ant bin directory. ANT_HOME points to the ant top ant directory. The classpath is set up for the bin and library directories.
Can you explain how to run ant?
Rick Salsa
Ranch Hand

Joined: Jul 17, 2001
Posts: 173
Hi Charlie,
You'll need to create an xml file and name it build.xml. Inside there you'll specify targets, like compile, etc..
These target will call commands called tasks to do different things. Take a look at the ant documentation for examples.
Once this is done, make sure your in the directory that contains the build.xml file. At the prompt, type in ant. That should run the file for you.
If you have any other questions, let me now. You might want to look the Jakarta Forum here at the ranch. A lot of questions on ant get posted there..
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
Ant is excellent, but quite complex to get into ... moving this to the Jakarta Projects forum.
sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
Hey Charlie,
In your ANT bin directory there is an exe file called ant/ant2, dunno what but u can chk and all u have to do is call that from the cmd line, pass the name of the ant file that u want to run, (generally u write a main.xml that calls all the ant files that u want to run) and also pass the source for the classes that u want to compile/copy in the arguments(if u have specified any in your dtd, generally there is a SOURCE_HOME)
D:\ant\bin\ant2 -buildfile main.xml -DSOURCE_HOME=D:\ant\build
Please mail me at if you need any more info

sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
By exe i meant an executable batch/command file
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Might I recommend this article written by one of the JavaRanch Sheriffs?

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: Ant tool?
It's not a secret anymore!