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:

[text]sudo apt-get install java-package sun-java6-jdk[/text]

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:

[text]sudo mkdir /opt/flex[/text]

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:

[text]
cd ~/Desktop
unzip flex_sdk_4.zip -d tempflex
[/text]

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:

[text]sudo mv tempflex/* /opt/flex/[/text]

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:

[text]
cd /opt/flex
ls
[/text]

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:

[text]gedit ~/.bashrc[/text]

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).

[text]export PATH=/opt/flex/bin:$PATH[/text]

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”:

[text]mxmlc –help[/text]

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

Tags: , , ,

32 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?

  10. Uday says:

    Thanks a lot Steve Love :) . It works!

  11. Kevin says:

    Thnx for this neat tutorial, it was very helpful!

  12. tosa says:

    thanks a lot steve…i works and i can do my work again

  13. MicroAngelo says:

    Just a quick message to say “Thanks!” for an excellent and speedy tutorial!

    Also, to give back, I can confirm that this works in the new Lucid Lynx (Ubuntu 10.04) using the OpenJDK JRE (rather than Sun’s, which has now been moved to the multiverse) and the new Flex SDK 4 that can be downloaded from:

    http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.zip

    Thanks again!

  14. Arielle says:

    Thanks for the how-to, following it now. But I was wondering why use gksu to edit .bashrc when you’re supposed to own the file anyway?

  15. motiur says:

    Would love it you had given a sample “Hello World” flash code to compile. Thanks anyway.

  16. [...] I’m trying to use Open Source solutions for resource development more and more lately, and most recently switched to Linux (Ubuntu) on my laptop with a view to Flash development with the free Flex SDK. Developer Steve Love has an excellent blog post on doing the main setting up here. [...]

  17. BL says:

    when I type in mxmlc –help it tells me mxmlc command not found :(

  18. Kim Hansen says:

    Thanks a lot for this article!

    Now I can generate Linux versions of my application JEPUM, which is being requested in the Linux community.

  19. jerry says:

    Good tutorial. Worked fine with FlexSDK_v4.1 But…
    Binary for v3.5 seems totally incompatible with dos2unix, at least with Fedora 13×64 OS I’m using now.
    Had some compile errors with v4.1 and wanted to go back to v3.5 when the code I’m working with was written. No luck, tons of theme errors so lots of find-replace to do :(

    I’ll keep working on getting v3.5 to work.

    Thanks.
    jerry

  20. Jonkemon says:

    Great tutorial, simple instructions and worked perfectly first time, thanks!

  21. chan says:

    hi

    This very useful!
    Thank you.

  22. gabriel says:

    hi there. thanks for the tutorial. i followed the steps for ubuntu 10.04 but i’m getting the following error:
    /bin/sh: Can’t open /opt/flex/bin/mxmlc
    any help will be greatly appreciated! ARGH!

  23. Ryan Cook says:

    This is a great tutorial, thanks for writing it Steve. The setup worked perfectly.

Leave a Reply