in

    Apache Ant is a software application used to build Java projects. This book’s examples include an ant build script (build.xml). To compile the examples in this book, 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, choose the save option, and you will obtain a ZIP file which is placed in the directory you chose to save it to. Using Windows, double click the ZIP file to examine the contents. You can then copy the folder, contained in the ZIP file, to your hard drive. The C: drive was chosen in the following example. Figure B.2 shows Apache Ant about to be copied to the C: drive.

Figure B.2: About to Copy Apache Ant

About to Copy Apache Ant

    You now need to locate the BIN directory for Apache Ant. Because I copied Apache Ant to the root of my C: drive, the path to my BIN directory is as follows:

c:\apache-ant-1.6.5\bin\

    Your BIN path may be different, depending on the version of Apache Ant used, or where you have copied Apache Ant. The BIN directory will always be just inside of the main Apache Ant directory. You will need to know this path for the next step.

    Next, select “Control Panel” from your Windows start button. The Windows start button is the large green button on the bottom left of the screen. If your control panels are in “Category View”, as seen in Figure B.3, you will need to select “Classic View”.

Figure B.3: Category View for Control Panels in Windows

Category View for Control Panels in Windows

    From the Classic View of the control panels double-click the “System” icon, and choose the advanced tab. You should now see Figure B.4.

Figure B.4: Advanced Options

Advanced Options

    Choose “path” under “System Variables”, and click “Edit”. You should now see Figure B.5.

Figure B.5: Edit the Path

Edit the Path

    Add the path to your BIN directory to the front of the system path. Make sure you put a semicolon (;) at the end of your BIN directory’s path. Semicolons separate elements of the system path. Also, be sure there are no additional spaces between elements of the system path.

    You will also need to add JAVA_HOME and ANT_HOME to your “System Variables”. JAVA_HOME should be set to the directory that Java is installed under. For my system, JAVA_HOME is set to:

C:\Program Files\Java\jdk1.6

    You also need to set ANT_HOME to the directory you installed ant into. For my system ANT_HOME is set to:

C:\apache-ant-1.6.5

    You can now test Apache Ant. Open a “Command Prompt” window and enter the command “ant”. You should see ant display an error message, as seen in Figure B.6.

Figure B.6: Testing Ant

Testing Ant

    Ant was trying to run but had nothing to build! Now that Apache Ant is installed, you are ready to compile the book’s examples.


Copyright 2005 - 2010 by Heaton Research, Inc.. Heaton Research™ and Encog™ are trademarks of Heaton Research. Click here for copyright and trademark information.