A Tour of Ant with a Small Exercise

At this point, Ant is installed on your system and ready for use. In this section, we’ll build a simple project using Ant. In keeping with the time-honored tradition of computer language textbooks beginning with a “Hello, World” example, we’ll construct a “Hello, World” program and use Ant to build and assemble it for execution and distribution. We’ll have two Java classes and a properties file involved just to make it slightly more interesting, and we’ll end up with an executable Java Archive (JAR) file that is ready to run. Here’s what we start with:

  • HelloWorld.java

  • HelloWorldClient.java

  • Hello.properties

  • MANIFEST.MF

The .java files will need to be compiled and placed in the proper package directory hierarchy. ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.