Based on Steve Love’s great tutorial-post and on a great post of Life of a programmer geek blog I summarize here a possible quick tutorial for those that wish to develop flash using all open source tools.
What do you need to install Flex on Linux?
1) Check Java version
Because it has been reported that version 7 gives you trouble for open source flash. You might as well go for version 6, to check the currently installed version type:
~$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
2) Get Open Source Flex SDK (under Mozilla Licence)
Simple download it from here, unzip it as you prefer and save it anywhere.
3) Place it under /opt/flex
If you are following the Filesystem Hierarchy Standard, one should place the package under /opt/flex (or other name of your choice).
4) Change permissions to +x
Now if you go under the /opt/flex directory and execute the /bin/mxmlc it will report that you actually do not have permissions. To change this is fairly easy, just type:
sudo chmod +x /opt/flex_sdk_3/bin/mxmlc
5) Link the terminal to the compiler
Now if you type mxmlc (the compiler) your system don’t know where the compiler is! So you need to add a new location to the path on the .bashrc, simple edit it with your favourite editor (use sudo), mine is vim, and add this line in the end:
Now just test by typing:
~$ mxmlc -help
Adobe Flex Compiler (mxmlc)
Version 3.4.1 build 10084
EXTRA) How to resolve the /opt/flex_sdk_3/bin/mxmlc: /bin/sh^M: bad interpreter: No such file or directory error?
This is very simple, actually what is happening is the DOS newlines are causing errors in the shell script execution…
Install this tool (I’m using Ubuntu, so will use apt-get for this):
sudo apt-get install tofrodos
Next simple execute the dos2unix conversion on the mxmlc executable, and the problem is fixed:
sudo dos2unix /opt/flex_sdk_3/bin/mxmlc