Getting Ant


Ant is a build tool made with Java in mind, allowing Java developers to have a tool that fits with the Java environment and mentality. It is an expandable, open source tool that is constantly being upgraded and extended to support the latest Java standards. One specific standard that we use in this chapter is the WAR file, which will allow us to package up our application. We'll learn more about what a WAR file is, and why it's important, in a little bit.


Note: WAR stands for Web Application Archive.

Ant has an active community of supporters who have helped make Ant the preferred build tool in the Java community (pun intended). With that in mind, we've chosen to use Ant for the examples in this book. At the end of this book, you too might be one of those supporters or contributors. So...

How do I do that?

Ant is provided in both source and binary form. For the examples and work we are doing in this book you'll only need the binaries. To get the binaries, go to http://ant.apache.org/bindownload.cgi and download a binary distribution. Choose a binary format that is appropriate for your system.


Tip: If you are on a Unix-based system, you might want to choose the /usr/local/ directory. On a PC you might want to install Ant in a top-level directory off of the C:\ drive.

Note: For more about Ant, check out Ant: The Definitive Guide (O'Reilly).

Once you've unpacked the download, you'll need to set the ANT_HOME environment variable to point at the directory in which you unpacked Ant, which is /Users/samjr/apache-ant-1.6.2 in this example. You also need to add Ant's bin directory to your command path. In this example it is /Users/samjr/apache-ant-1.6.2/bin. You can find more information about configuring and installing Ant in the Ant manual, available online at http://ant.apache.org/manual/.

You can do a quick check to see if Ant is working by typing ant -versionon the command line. You should see something like this:

     [samjr]$ ant -version     Apache Ant version 1.6.2 compiled on July 16 2004 



JBoss. A Developer's Notebook
JBoss: A Developers Notebook
ISBN: 0596100078
EAN: 2147483647
Year: 2003
Pages: 106

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net