Java Reference
In-Depth Information
Installing Apache Ant
Apache Ant is a software application used to build Java projects. This topics examples
include an ant build script ( build.xml ). To compile the examples in this topic using this
build script, you will need to install Apache Ant. The latest version of Apache Ant can always
be found at the following URL:
http://ant.apache.org/
When you download Apache Ant, you will obtain a tar.gz file. Using the finder, copy
this file to your user directory. The rest of the install will be done from a terminal window.
Open a terminal window and enter the following command:
su
This will transform you into the super user. To install ant, you must be the super user. If
this is the first time that you have logged in as the super user you will be given a brief warn-
ing.
Next, we will need to create a directory to store ant in. Do this with the following com-
mand:
mkdir /usr/local
You may get an error telling you that this directory already exists. If you do get this error,
simply ignore it. Now you need to move to this directory with the following command:
cd /usr/local
You are now ready to unpack the ant archive that you downloaded earlier. This is done
with the following command:
tar zxvf /home/jeff/apache-ant-1.6.5-bin.tar.gz
Of course, if you downloaded a different version, make sure to change the filename ap-
propriately. Also make sure you use your home directory. In the command above, the home
directory is set for a user named “jeff”. If the unpack is successful, you will see dozens of files
stream by on the terminal. When it is all done, your terminal will look similar to Figure D.2.
Search WWH ::




Custom Search