Appendix E. Installing Apache Ant
The Java build tool Apache Ant is not required for the installation or normal operation of the JBoss Enterprise Application Platform. However, it is occasionally needed for some configuration tasks and also for building and deploying some applications.
Note
If running a development workstation, Apache Ant may already be installed.
Note
To learn more about
Apache Ant, visit the project's website at http://ant.apache.org.
Procedure E.1. Installing Apache Ant on Red Hat Enterprise Linux
- Download and install
Apache Anton Red Hat Enterprise Linux Repository by issuing this command:[localhost]$ sudo yum install ant
Procedure E.2. Installing Apache Ant on Other Operating Systems
Download and Extract
Download theApache Antbinary release from http://ant.apache.org/bindownload.cgi.Once it is downloaded, extract it in a preferred installation location, such asc:\Program Files\Apache\Ant\or/opt/apache-ant-1.8/.Add the ANT_HOME Environmental Variable
Next, create create an environmental variable calledANT_HOME. This variable has to contain the path created in the previous step.- Do this on Red Hat Enterprise Linux by adding the following line to the
~/.bash_profilefile, substituting the path with that created above.export ANT_HOME=/opt/apache-ant-1.7.1 export ANT_HOME=/opt/apache-ant-1.7.1
- On Microsoft Windows, do this by click on the and opening the then selecting System -> Advanced -> Environment Variables. Create a new variable, calling it
ANT_HOMEand configure it to point to theantdirectory.
Include
binin thePATHNext, append theantinstallation'sbindirectory thePATHenvironmental variable.- On Unix/Linux systems, one does this simply by adding the following line to the
~/.bash_profilefile after the one which sets theANT_HOMEvariable:export PATH=$PATH:$ANT_HOME/bin export PATH=$PATH:$ANT_HOME/bin
- On Microsoft Windows, do this task by opening the then selecting System -> Advanced -> Environment Variables->System Variables -> Path. Create a new variable, calling it
ANT_HOME. Next, add a semicolon and%ANT_HOME%\binto the end of the path value.
To test the Apache Ant installation, run
ant -version from within a command line shell. The output should look similar to this:
[localhost]$ ant -version Apache Ant version 1.8 compiled on June 27 2008