Installation

To be able to use flex2ant, you first need to install the Adobe Flex 2 SDK. Go over to flex.org and download the free SDK, follow the instructions given to install the SDK for your platform.

After you've installed the Flex 2 SDK you need to install Eclipse (if you haven't done so already). Go over to the downloads section at eclipse.org and download the latest version of the Eclipse SDK, follow the download and installation instructions for your platform (this includes downloading and installing the Java run-time).

Now you have both the Flex 2 SDK and Eclipse installed it is time to install flex2ant. Download the flex2ant zip package from the link given in the download section in the menu above and unpack it to a folder of your choice (on Windows this could be e.g. c:\Program Files\flex2ant).

After you have unpacked flex2ant, start up Eclipse. When Eclipse is started select from the menu Window, Preferences.... The preference panel is now shown, go to the Ant section and select runtime.

Step 1

We're now going to add the flex2ant.jar file, that you unpacked from the flex2ant package to the Global Entries of the ClassPath tab of Eclipse. Make sure the ClassPath tab is active, select Global Entries from the list and click on the Add External JARs... button.

This will bring up an Open dialog. Browse to were you unpacked the flex2ant package and select the flex2ant.jar file from the build folder. If you see a message pop up like this then select Yes.

Step 2

Now activate the Tasks tab and click the Add Task... button.

This will bring up the Add Task dialog. Give the new task the name mxmlc and from the location drop down select your flex2ant.jar file (includes full path). In the left panel of the dialog a tree is now shown, select the Mxmlc.class in the org.flex2ant package folder and click OK.

Step 3

Ant now knows what a mxmlc task is. The only problem left, is that Ant doesn't know where the MXML compiler is located (installed with your Flex 2 SDK). Unfortunately, adding it to your system path doesn't make it visible to Ant and we don't like hard coded path values in our Ant build files either. So, we need to add a property to Ant itself telling it where to find to MXML compiler. Make the Properties tab active and select Add Property....

Add a property of the name mxmlc and set its value to the location where your MXML compiler is located (on Windows this could be c:\Program Files\Flex 2\bin\mxmlc.exe where as Linux users would point to the mxmlc file located in the bin directory of their Flex 2 installation).

Close the Eclipse Preferences dialog and you are ready to use the Flex 2 SDK from Eclipse.