Java ANT Projects

Java ANT Project 1

Java ANT Examples


How Can Use Apache Ant

Previous Home Next

Apache Ant's build files are written in XML. Each build file contains one project and at least one (default) target. The every target containing the task elements, and the each task element of the build file can have an id attributes and can later be referred to by the value supplied to this. this value is a unique value.


Mainly Project have 3 attributes inbuilt in the Apache Ant.

  1. Name-The name of the project which using Ant (Optionally)
  2. Default-The Default target to use when no target is supplied.
  3. (it's use Mandatory)
  4. basedir-The base directory from which all path calculation are done. This attributes might be overridden by setting the "base dir " property beforehand. (Optionally)

Why do you need a Build tool?

Mainly when time you using the Apache Ant , then you need to build tool. the build tool is very necessary , so you spend your day doing the following manually.

  1. Compile code.
  2. Package the binaries.
  3. Deploy the binaries to the test server.
  4. If you using the changing then test your changes.
  5. Copy code from one location to another.

If you are Using Eclipse with Ant :

We'll continue our Ant Tutorials with the starting program for print "Hello ANT World" then it's only execute a Java class. it's very simply to start by creating a simple hello program as shown as. In the Eclipse Ant is inbuilt. So it's simple run the program.

Simple Setting to Eclipse:

In the My Eclipse the Ant is Pre-Installed. there are most release  target which uses FTP to upload the files to a live server the ant FTP task requiring some extra libraries (.jar files):

  1. commons-net-*.jar
  2. jakarta-oro-*.jar

After that Copy the files into the ant lib folders of your Eclipse install. the folder commonly locate that in which drive install the Ant. then shows like as: C:\Program Files\Eclipse\plugins\org.apache.ant_*\lib.

After you go to Eclipse and select window ---->Preferences and select Ant----> Runtime. and in the classpath tab, select Ant Home Entries, click Add External JARs, and select the jar file you copied to the Ant lib folder.

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Comment / Feedback: