Getting the Flex command line compilers can be a bit of a trick. I recently started working with Flex and it took me a little time to get the configuration right.
The 5 step process to get the Flex compiler to work in Windows:
1. Download Flex Builder from Adobe
2. Download Java SDK from Sun
3. Install both on your computer
4. Go to the Flex Builder’s SDK bin folder and edit the jvm.config file. (It should be in something like C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin if you installed Flex Builder in C:\Program Files). Open the file with notepad and edit the file to change the java.home parameter. By default it might be blank. Edit it to point to Java SDK.
After you’re done it should read something like:
(This is assuming that your JDK has been copied to C:/Program Files/Java/jdk1.6.0_10. To be precise, you should have folders like bin, demo, lib and jre directly under the jdk1.6.0_10 folder.)
5. Now go to your desktop and right click “My Computer”. Click the Advanced tab and click Environment Variables. In system variables, double click “Path”. Append the following variables to the existing string:
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin;C:\Program Files\Java\jdk1.6.0_10\jre\bin;
The first one points to the Flex SDK’s bin directory and the second one points to the JDK’s bin directory.
That’s it !!!
Checking if the command line Flex Compiler is working
You can open up the DOS command line and type “mxmlc” and press enter to check if eveything’s fine. It should show the following:
Adobe Flex Compiler (mxmlc)<br />
Version 3.0.0 build 477<br />
Copyright (c) 2004-2007 Adobe Systems, In mxmlc [options] [defaultVar]<br />
Use 'mxmlc -help' for more information.<br />
Checking if the Java Compiler is working
Open up the DOS command line and type “java”. It should give you:
Usage: java [-options] class [args...]<br />
(to execute a class) or java [-options] -jar jarfile [args...]<br />
(to execute a jar file)
If the system throws an error message on any of the above two steps, you’d have to check again if everything has been set right.
So well there we are…..ready to flex our creative muscles and roll out some great flash applications.