There are two ways to setup the Apache Flex SDK. You can use the provided Apache Flex SDK Installer, an Adobe AIR application that automates the process (on Windows or OS X/macOS). Or you can install it manually which obviously requires a greater comfort with your platform but provides more flexibility with the installation details.
Installing Apache Flex SDK Using the Apache Flex Installer
- Download the installer binary for your operating system (Window, Mac
- Run the installer
- Select the version of the SDK you want to download. The Apache Flex project suggests that you download latest released version.
- Select the Flash Player version. The Flex project suggests that you leave it at the as the default. Click Next.
- Select a directory where you want the SDK installed. Click Next.
- Check all of the license agreements. Click Install.
- Wait for the installer to download and install the Apache Flex SDK.
Installing Apache Flex SDK Manually
NOTE: This can be a lengthy and involved process.
Prepare your system
- Download and install the latest Java JDK
- Download and install the latest version of Ant
- Download and install the latest version of Git
- Download and install the latest JUnit
Setup the Folder Structure
- Create the following directory structure on your computer for the Flex SDK, usually stored in the root or Documents directory.
/ApacheFlex /ApacheFlex/dependencies /ApacheFlex/source
- Open a terminal and change the directory to:
- Run the following git command to download the Flex SDK source:
git clone https://git-wip-us.apache.org/repos/asf/flex-sdk.git flex-sdk
- Run the following git command to download the TLF source:
git clone https://git-wip-us.apache.org/repos/asf/flex-tlf.git flex-tlf
- Change to the flex-sdk directory:
- Switch to the ‘develop’ branch (Optional):
git checkout develop
Edit the Environment Properties
For the build scripts to work you need to set the Environment Variables. The environment properties file contains the environment variables which point to the locations of the dependencies you will use throughout the process. These are used by the various build scripts to run and compile the SDK. You will add additional environment variables through out the rest of this tutorial. When you run the build script later the script will validate the paths provided and warn you if they are incorrect.
- Create the environment properties file:
flex-sdk directory create a copy of the
env-template.properties file and name it
Since you’ve already installed Java and Ant, set the path of those by appending the following at the end of the
- Next add the path to the TLF directory:
Add Required Dependencies
Adobe AIR SDK
- Download the Air SDK Flex Edition (Be sure to download the edition specifically made for Flex).
- Extract to:
where the final directory name refers to the version of the AIR SDK you downloaded.
- Set the
AIR_HOMEenvironment variable to the AIR SDK path you chose in the previous step. For example,
Adobe Flash Player Projector
- Download the Flash Player Projector
- Run the installer. The Projector Content Debugger install program does not install into anywhere (for me at least). Once you run the installer you must copy it to the location you want. In this case, copy it to the
Note: on OSX, append ‘.app/Contents/MacOS/Flash Player Debugger’ to the path to the Flash Player.
/ApacheFlex/dependencies/player/Flash Player.app/Contents/MacOS/Flash Player Debugger
- Set the
FLASHPLAYER_DEBUGGERenvironment variable to the installation path of the projector.
env.FLASHPLAYER_DEBUGGER=/ApacheFlex/dependencies/player/Flash Player.app/Contents/MacOS/Flash Player Debugger
You may also be able to use the Flash Player Plug-in. It is usually located here:
/Library/Internet Plug-ins/Flash Player/
The full path would be:
/Library/Internet Plug-ins/Flash Player.app/Contents/MacOS/Flash Player Debugger
Adobe Flash Player playerglobal.swc
- Download playerglobal.swc – This is on the same page as the content debugger you just downloaded.
- Copy it to:
where the number corresponds to the version you download.
- Rename copied file to ‘playerglobal.swc’
- Set the
PLAYERGLOBAL_HOMEenvironment variable to:
Adobe Pixel Bender Toolkit
- Download Pixel Bender for Windows or for Mac
- Install Pixel Bender. When you install the program it gives you the option to choose the install location. Copy this location before you install.
- Set the
PIXELBENDER_HOMEenvironment variable to the installation directory.
For testing, the Adobe Flash Player’s
mm.cfg file must have the proper properties set and a
FlashPlayerTrust file must allow local SWFs to access local files.
- Open the
mm.cfgfile in an editor. The location of the
mm.cfgfile depends on your operating system. See this page.
- If it doesn’t exist, manually launch the Adobe Flash Player Projector content debugger and it should create the
mm.cfgat that time.
- Add or verify that the following entries are in the file:
- In the same directory as the mm.cfg file is the FlashPlayerTrust directory.
- Open that directory and create a new text file called ApacheFlex.cfg.
- In that file add the parent directory of Apache Flex SDK. For example:
#Path to Apache Flex Source /ApacheFlex/source
- Save the file.
Set the Build Properties
- In the flex-sdk directory is the build properties file. This contains the version numbers of the software you downloaded.
- Open this file and set the following values to the version of the Flash Player and AIR SDK you are using:
# Flash player version for which player global swc to use playerglobal.version = 12.0 # AIR version number air.version = 4.0
These values are used in building the path to the SDK. So if you saved the playerglobal.swc to the following directory:
the value of the playerglobal.version would be 12.0.
Note: Since this value builds the path be sure to use the full value, 12.0, instead of 12 if your path contains it.
Note: If you are using a new version of the Flash Player that is not yet mentioned in the version of the Flex SDK you are working with you may get the message:
Error: configuration variable ‘swf-version’ value contains unknown token ‘playerglobal.swfversion’
You’ll need to update the
/ApacheFlex/source/flex-sdk/frameworks/build.xmlfile with an updated version check code.
if you want to reproduce, please indicate the source:
Getting started with flex – Installation or Setup (Apache Flex) - CodeDay