Java is not a language with training wheels. It is a language for professional programmers.

— Hebert Sheildt

Building With Ant

Ant is a build tool, it stands for Another Neat Tool, and it helps us perform a lot of common functionalities by just configuring the build file.

Setting up the environment:
1. Download ANT Apache Ant and extract the zip file.
2. Create an environment variable “ANT_HOME”, setting the value to the location where Ant is extracted.

In my case, the value of “ANT_HOME” is “C:\ant”.

This is a simple example in which HelloWorld class prints the message “Hello World” on the screen.


At least one <project> tag is required,
name-> The name of the project, it is optional
default-> The build.xml can be have many <target>, this attribute specifies which <target> is default.
basedir->The root directory of the project, it is optional.

The <project> tags allow us create key-value pair; whenever the key is used it represents the value.
To use, the $ sign should be followed by the property name inside curly braces.

<target> is also a mandatory tag, it contains the set of instructions required for the build process.

This tag states that:
1. Run >java HelloWorld class file.
2. CLASSPATH is “p1”.
3. BUT, before step 1 and 2, process the tag.

To execute the build file, use the following command:

© Copyright © 2013 All Rights Reserved.

Free Web Hosting