Setting up Apache Ant task

i) Before you can run Apache Ant effectively, you will need the Java Development Kit, available for download at:
ii) Install the Java Development Kit, then you will need to add the jdk/bin directory to your system PATH variable. See adding a PATH environment variable: Windows, Mac, Linux (Ubuntu).

Windows Users, you can add to your path from the command prompt using the following command. Be sure to substitute the c:\Java\jdk\bin directory with the directory to your own jdk installation.


1) Download Apache Ant 1.7.1 or higher from
2) Extract the compressed file (e.g. - zip, tarball, etc) to a location on your computer, preferably without spaces in the path.
3) Append the /bin directory on your computer's PATH environment variable, using one of the methods described in "step ii."
4) Create an environment variable named ANT_OPTS with the following values to increase the JVM's heap boundaries and perm gen space to be more friendly to Flex/Flash builds:

-XX:MaxPermSize=128M -Xms128M -Xmx512M

Windows Users, the variable here has been created as a user variable. But may be more useful as a system variable depending on your needs:


5) Download the Flex SDK and extract it to a folder on your computer.

If you are using Linux and wish to use the ADL support to execute your test suite(s), download the AIR SDK for Linux @ and extract the bundle on top of Flex SDK so the FlexUnit Ant task may use it correctly.

7) Create an environment variable named FLEX_HOME with the value of the absolute path to the directory in which the Flex SDK was extracted.

Windows Users:


8) Download the stand alone debugger (projector) Flash Player for your platform and install the player. If running on Linux, be sure to create a symlink to the executable with the name gflashplayer which is in a directory available on PATH environment variable.
9) If not running on Linux, associate the mime-type for SWF files with the stand-alone debugger Flash Player. If done correctly, opening a SWF file directly (e.g. - double-clicking the file) should cause it to open in the stand-alone player.

10) Download the latest FlexUnit4 source code bundle @
11) Extract the FlexUnit4SampleCIProject from the bundle into a location you'd like to use for your project.
11B) If they exist, delete all folders and files under the /src/main/flex and /src/test/flex locations as well as the pom.xml file since this is a Maven build file.
12) Place any source code under /src/main/flex and your test code under /src/test/flex. Please note, you don't have to use these folder locations, the included build scripts are just setup to work without edits with these paths.
13) Sample build scripts are provided within the template as files beginning with the prefix build. There is a sample for using the stand-alone Flash Player and ADL to execute your test suite(s). These build scripts are just suggestions, there are many different ways to write an Ant build script, these samples are solely intended to present Ant in a simple manner.
14) When in doubt on how to organize your project or which build script to use, check out the comments in all of the build files as well as the README.txt file which comes with the FlexUnit4SampleCIProject.
15) Type in the command "ant" (without quotes) and the project should build.

The "BUILD SUCCESSFUL" message in the command line will alert you to a proper configuraton. Use and test this configuration with the sample project before moving onto any others.