|
1.2. Getting AntAnt comes in two editions: binary and source. The binary release is ready to use: just download, uncompress, and go. The source release allows you to see what makes Ant run and to make modifications of your own if you choose. To download either, go to http://ant.apache.org/ and click a link under the Download title (either Binary Distributions or Source Distributions). Downloading a binary edition is easiest: Just click the Binary Distributions link and download the .tar.gz or .zip compressed file.
1.2.1. Installing AntTo install the binary distribution of Ant, expand it. Here's the resulting directory layout (only the bin and lib directories are needed to run Ant): ant |___ bin Ant launch scripts | |___ lib Ant jars | |___ docs Ant documentation | |___ etc XSL for formatting Ant XML output You need to perform the following steps to complete the setup process:
If you've expanded Ant in c:\ant on Windows, you'll end up with a new directory, c:\ant\apache-ant-1.6.1. If you've installed the JDK in c:\jdk1.4 (and the Java bin directory is C:\jdk1.4\bin), set the environment variables like this: set ANT_HOME=C:\ant\apache-ant-1.6.1 set JAVA_HOME=C:\jdk1.4 set PATH=%PATH%;%ANT_HOME%\bin In Unix (bash), assume Ant is installed in /usr/local/ant. Here's how you'd set up the environment: export ANT_HOME=/usr/local/ant export JAVA_HOME=/usr/local/jdk1.4 export PATH=${PATH}:${ANT_HOME}/bin In Unix (csh), you'd do something like this: setenv ANT_HOME /usr/local/ant setenv JAVA_HOME /usr/local/jdk1.4 set path=( $path $ANT_HOME/bin )
To compile Java code, you'll need a working JDK on your machine. If you only have a Java Runtime Environment (JRE), Ant won't be able to do many things you need it to do. Also note that the Microsoft JVM/JDK is not supported.
1.2.2. Testing AntWith Ant in your path, you should be able to run it at the command line. To test this, type ant -version, which should display the current Ant version: %ant -version Apache Ant version 1.6.1 compiled on February 12 2004 If Ant's not working, you'll see something along these lines: -bash-2.05b$ ant -bash: ant: command not found Here's the Windows version of the same error: C:\>ant 'ant' is not recognized as an internal or external command, operable program or batch file. In that case, go back over the installation instructions, and look at the Ant documentation for troubleshooting issues. |
|