Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News A Look at Flex 3.0's Java-based Compiler API

A Look at Flex 3.0's Java-based Compiler API

This item in japanese

Integrating Java and Flex has proven challenging in some cases. Adobe is trying to make things easier with its release of Flex 3 which includes a Java-based compiler API. This API lets you compile SWF and SWC files from Java applications, supporting the same options as mxmlc and compc command-line tools.

The underlying concept relies on Java developers creating Flex Application objects. These objects represent a Flex application, and are built by and setting its mxml as well as its output and building it:

Application application = new Application(new File("../apps/TestApp.mxml"));
application.setOutput(new File("../apps/TestApp.swf"));
long result =;

Some of the highlights of the Flex Java API are:

  • Generate reports and provide information such as progress and logs during the compilation process as well as reports about the application, library, or project that you are compiling

  • Incremental compilation that is more efficient because it only recompiles the virtual file that was changed and not all files that are in the application

  • The capability to create application and library source files at run time and to compile these files into applications and libraries.

  • Create Flex applications in memory and compile them to SWF files without ever having an MXML file on disk.

There are already some tools that can help out Java developers wanting to build Flex applications. Antennae, a set of templates for building complex Flex projects with Ant has been available for some time now. Also based in mxmlc and compc, Antenne gives developers another means for intergrating Flex into their Java projects.

The Flex 3 Java-based compiler API can be found here.

Rate this Article