How to install and set up Adobe Flex SDK on Ubuntu linux

With the open source Adobe Flex SDK, developers using any operating system and any text editor or IDE can create rich Internet applications that compile into SWF files. This guide is for those wanting to install and set up the Flex SDK on Ubuntu linux.

What do you need to install Flex on Ubuntu?

  1. The Flex SDK
  2. Sun Java (needed for compiling the SWF binaries)

Set up and install Flex

Step 1. If you haven’t already, install Java. (If you aren’t sure, go ahead and try this step anyway.) First open up a terminal (Accessories menu > Terminal) and type the following:

sudo apt-get install java-package sun-java6-jdk

This will take several minutes while the packages download and install. You’ll also need to agree to Sun’s license.

Step 2. Download the Flex SDK. The rest of this guide will assume you saved the SDK to your desktop: ~/Desktop.

Step 3. We need to create a directory for the Flex SDK. In a terminal window, enter the following:

sudo mkdir /opt/flex

The “opt” directory is generally where optional application software packages live. (More info on the linux file system.) All we did here is make a new “flex” directory inside “opt”.

Step 4. Now we need to unzip the Flex SDK. Type the following in a terminal window:

cd ~/Desktop
unzip flex_sdk_3.zip -d tempflex

What this does is unzip the contents of your download into a new and temporary directory on your Desktop called “tempflex”.

Step 5. After that’s complete, we need to move these files to “opt/flex” which we’ve already prepared for the SDK. Type the following in a terminal window:

sudo mv tempflex/* /opt/flex/

This will move the contents of “tempflex” into “opt/flex”. If you want to make sure you moved everything, you can type the following into a terminal window:

cd /opt/flex
ls

You should see a list of all the files in the directory.

Step 6. Last step. All we need to do now is let Ubuntu know where the new Flex compiler lives. Type the following in a terminal window to open up “~/.bashrc” in a text editor:

gksudo gedit ~/.bashrc

Note the use of “gksudo” because we want to run sudo graphically. For more information on this, see this article.

The text editor will open your ~/.bashrc profile and we only need to add one line (I added it at the bottom of the file, but I’m not sure it matters).

export PATH=/opt/flex/bin:$PATH

Save the file and close the text editor. Then exit all open terminal windows before opening a new one. This should ensure that your terminal loads the path that we just added.

You should now be able to compile your Flex projects with the “mxmlc” compiler command. To make sure, type the following in a terminal window to bring up the “help”:

mxmlc --help

Looks good? Great. You’re all set. Happy Flex-developing.

Tags: , , ,

13 Responses to “How to install and set up Adobe Flex SDK on Ubuntu linux”

  1. pablo says:

    thanks
    easy to follow and helps.

  2. dfreeman says:

    My Windows installation crashed and burned on my home box and I had no desire to go back. Still needed to be able to do AS3 at night. Out of all the stuff I have waded through trying to get a reasonable set up of flex running, this by far has made the most sense and has been the most complete. Thank you!

  3. Tom says:

    Thanks a lot!
    One small issue is remaining for me: after setting mxmlc as executable via ‘chmod 755 /opt/flex/bin/mxmlc’, I now get the following error when starting mxmlc:
    ‘bash: /opt/flex/bin/mxmlc: /bin/sh^M: bad interpreter: No such file or directory’ although /bin/sh exists of course. Thanks for any suggestion!

  4. ben says:

    there are many more complicated how to’s outthere, this one is really nice and works quite well. thanks a lot for that

  5. Hamza says:

    Hello ,
    Thank you for the great tutorial , though
    I go through the tutorial steps so far and everything is working great except It does not see adl file in my ubuntu installation in order of this command

    rake air:build
    when trying out this Restfulx.github.com , building a standalone AIR application .

    giving me this error :

    hamza@hamza-laptop:~/apptemp/ttt$ rake air:run
    (in /home/hamza/apptemp/ttt)
    Compiling /home/hamza/apptemp/ttt/app/flex/Ttt.mxml
    Loading configuration file /opt/flex/frameworks/air-config.xml
    Loading configuration file /home/hamza/apptemp/ttt/app/flex/Ttt-config.xml
    /home/hamza/apptemp/ttt/app/flex/Ttt.swf (500672 bytes)
    Moving /home/hamza/apptemp/ttt/app/flex/Ttt.swf to /home/hamza/apptemp/ttt/bin-debug
    Created /home/hamza/apptemp/ttt/bin-debug/Ttt-app.xml descriptor.
    Done!
    Running AIR application with descriptor: Ttt-app.xml
    Could not run the application with descriptor: bin-debug/Ttt-app.xml. Check console for errors.

    what do you think !?

  6. Narayan says:

    Hi , dat’s awesome.. it was grt… tutorial i like it

  7. rajesh m says:

    thanks,

    this line in one of your comments did the trick for me:

    sudo dos2unix /opt/flex_sdk_3/bin/mxmlc

    was struggling with this part.

  8. Bruno says:

    Thank you for this tutorial! I always wanted to develop Flash on linux :)

  9. Paul Clark says:

    Thanks for the tips – I don’t think I’ve ever had thought of that dos2unix bit. But what on earth is mangling the line endings? ZIP?

Leave a Reply