Flash Builder & Apparat example: BUILD FAILED “java.io.IOException: Cannot run program “…/mxmlc” (in directory “…/apparat-ant-example”): error=2, No such file or directory

Made sure my Flash Builder 4.5 on OSX 10.5 is set to use Java 1.6 (out of the box it came set to use JVM 1.5).

Followed the instructions on webdevotion.be and cultcreative.com.

When it came time to do “Run As > Ant Build” I kept getting this error:

Buildfile: /your_path_to_example_folder/apparat-ant-example/build/build.xml
clean:
compile:

BUILD FAILED
/your_path_to_example_folder/apparat-ant-example/build/build.xml:64:
Execute failed: java.io.IOException: Cannot run program "/Applications/Adobe%20Flash%20Builder%204.5/sdks/4.5.0/bin/mxmlc"
(in directory "/your_path_to_example_folder/apparat-ant-example"): error=2, No such file or directory

Total time: 860 milliseconds

After trying a bunch of things, it turned out it was a permissions problem.

To fix it, I swapped Flex SDK to one outside of /Applications/ folder. Inside the project’s build.properties I updated FLEX_HOME line to:

FLEX_HOME=/your_path_to_sdk/Flex_SDKs/4.1.0

instead of

FLEX_HOME=/Applications/Flash%20Builder%204.5/sdks/4.5.0

and it worked.