Setup on Windows

The following instructions have been tested on Windows XP Professional SP2. Be sure that you've already downloaded the source code from the repository.

Install the latest version of Cygwin

Download Cygwin's installer, setup.exe, here and run it (Vista/IE7 users may need to right-click on the link and save the file locally before running it, as it may not run directly from clicking in the browser). You can accept the default settings, except that you must set the Default Text File Type to "DOS / Text".

There is no official site from which to download Cygwin; the setup program offers a number of mirrors for you to choose. Some of them can be flaky, so if you have a problem, try a different mirror. We've had good luck with ftp://mirrors.kernel.org and http://mirrors.kernel.org.

Double-clicking C:\cygwin\Cygwin.bat opens a window in which you can enter command lines. You'll probably want to keep a shortcut to this somewhere convenient.

(Optional) Install J2SDK 1.4.2_14

If you intend to build an older branch (e.g. branches/3.x), you need J2SDK 1.4.2_14.

Sun has archived this particular release here. Click on the "Download J2SDK" link and accept the license agreement. Click the "Windows Offline Installation, Multi-language" link to download the installer, which is named j2sdk-1_4_2_14-windows-i586-p.exe.

Run this installer, which requires administrative permissions. You should accept all of the installer's defaults. The branch setup scripts assume that the J2SDK will be installed at C:\j2sdk1.4.2_14. Wait until the installer completes, then restart your machine.

Install J2SE 5.0_13

Sun has archived this particular release here. Click on the "Download JDK" link and accept the license agreement. Click the "Windows Offline Installation, Multi-language" link to download the installer, which is named jdk-1_5_0_13-windows-i586-p.exe.

Run this installer, which requires administrative permissions. You should accept all of the installer's defaults. The branch setup scripts assume that the JDK will be installed at C:\Program Files\Java\jdk1.5.0_13. Wait until the installer completes, then restart your machine.

(Optional) Install Ant 1.6.2

If you intend to build an older branch (e.g. branches/3.x), you need Ant 1.6.2.

Download the Apache Ant Project's archived release of Ant 1.6.2 here and unzip it (Vista/IE7 users may need to right-click on the link and save the file locally before opening it, as it may unzip directly from clicking in the browser). . Put the apache-ant-1.6.2 folder that's inside the ZIP at the root of your C: drive. Make sure that Ant's bin folder is at C:/apache-ant-1.6.2/bin.

Install Ant 1.7.0

Download the Apache Ant Project's archived release of Ant 1.7.0 here and unzip it (Vista/IE7 users may need to right-click on the link and save the file locally before opening it, as it may unzip directly from clicking in the browser). . Put the apache-ant-1.7.0 folder that's inside the ZIP at the root of your C: drive. Make sure that Ant's bin folder is at C:/apache-ant-1.7.0/bin.

Configure Flash Player

mm.cfg

Download mm.cfg into your Windows home directory (C:\Documents and Settings\<username>). This file specifies

ErrorReportingEnable=1
TraceOutputFileEnable=1

If your system already has an mm.cfg file, paste these two lines into it.

FlashPlayerTrust

Open the directory C:\WINDOWS\system32\Macromed\Flash. If it doesn't already contain a directory named FlashPlayerTrust, create one. Download FlexSDK.cfg into FlashPlayerTrust. Vista/IE7 users may need to save the file onto the desktop first and then copy it locally into this directory; saving into a folder in the WINDOWS\system32 hierarchy directly from IE7 may quietly fail due to the browser's security model.

This file simply contains

C:\

so that SWFs anywhere on your C: drive are trusted to load local content. If you don't develop on C: drive, change the drive letter or add additional lines. We actually recommend you change this to be as restrictive as possible to your dev environment, either just the SDK directory or perhaps a specific development directory. Opening up your system to / can allow malicious SWFs to access data they normally might not be able to.

Also note: If you are getting "Security Sandbox Violation" errors (e.g. when running ant checkintests), you may need to use more specific directories than "C:\", e.g. "C:\dev\". You may put one on each line.

Test your setup

To test your setup, launch Cygwin, change your working directory to the trunk of the Flex SDK, and run its setup.sh script:

cd flex/sdk/trunk
source setup.sh

Execute

java -version

and confirm that Java 1.5.0_13 is being found.

Execute

ant -version

and confirm that Ant 1.7.0 is being found. If you see the warning "cygpath: can't convert empty path", you can ignore it.

You must be logged in to comment.

I have followed the setup process carfully, but when I enter "cd flex/sdk/trunk into Cygwin I get the error message "no such file or directory". I also cannot find the file setup.sh. I am getting confirmation that Java has been found but not for Ant. Can you help me, please.

Did you successfully get the source code using Subversion? Do you end up with a flex/sdk/trunk directory somewhere? If so, the setup.sh should be inside that 'trunk' directory.

You may need to adjust the path in "cd flex/sdk/trunk" based on where you placed the source code. This would work exactly as written only if the current directory at the time you do this is the directory containing the 'flex' directory from Subversion.

Ant will not be found unless you are able to successfully do "source setup.sh", because setup.sh puts Ant on the PATH for finding executables.