UPDATED: 20/02/10
This guide has been updated for Ubuntu 9.10 (karmic). Please note that this guide is only for 64-bit users. If you are running a 32-bit operating system then you won't need quite a few of the steps listed here.
Adobe's website lists some basic instructions for installing Flex Builder on a 64-bit system but it's a long way from being a complete guide. If you're new to Linux or don't have the patience for a complex installation my advice is to walk away now. This is not a simple installation and will take quite a bit of time to complete.
One of the main difficulties involved in the installation is that it requires the installation of a few 32-bit applications. If your system is set up like mine you probably already have a 64-bit version of Firefox, Eclipse and Sun's JRE installed. You also most likely have other applications that depend on those 64-bit versions so removing the 64-bit versions and replacing them with 32-bit versions isn't an option. The alternative is to install both 32 and 64-bit versions of those applications on the same system, but getting them to coexist creates an entirely new set of problems.
The following guide will walk you through installing the 32-bit versions of Firefox, Eclipse and Sun's JRE in a way that will also allow you to keep your existing 64-bit versions. Before proceeding you'll need to download the following files. Make sure to download them to your desktop as the steps below assume that these files can be found in your desktop folder.
- Adobe Flex Builder
- Eclipse 3.3.2 32-bit - The current version of Flex Builder will only work with Eclipse v3.3.x (europa). You can install Flex Builder in v3.4 but the mxml editor will not function properly.
- Firefox 3.6 32-bit
Since this guide is geared towards installing Flex Builder for Air application development I'd highly recommend installing the Air runtime before proceeding. Visit this link for a complete guide on how to install Air on 64-bit systems.
- Step one, put on a big pot of coffee because this is going to take a while.
- Install the following packages if they're not already installed.
Code:sudo apt-get install ia32-libs ia32-sun-java6-bin- We need to temporarily change the default JRE to the 32-bit version. First let's find out where your java symlink points to.
The command above will display something like the following:Code:readlink -e /usr/bin/java
Write down the path that's displayed in your terminal. If it's already set to the ia32-java-6-sun path then you can just skip the next step.Code:/usr/lib/jvm/java-6-sun/jre/bin/java
- Now set your 32-bit version of java as the default jre.
Code:sudo update-alternatives --set java /usr/lib/jvm/ia32-java-6-sun/jre/bin/java- Now we need to extract the 32-bit versions of Eclipse and Firefox. For this guide we'll use ~/Flex as our default installation directory.
Code:mkdir ~/Flex tar -xf ~/Desktop/firefox*.bz2 -C ~/Flex tar -xf ~/Desktop/eclipse*.gz -C ~/Flex- Let's make sure that we have the 32-bit versions of firefox and eclipse installed. This may sound like a pointless step but accidentally clicking on the wrong link can lead to a ton of wasted time and frustration.
Code:file ~/Flex/firefox/firefox-bin file ~/Flex/eclipse/eclipse- If they're both listed as "ELF 32-bit LSB executable" then continue to the next step. Otherwise you probably downloaded the wrong version which means it's time to start over...and possibly another pot of coffee.
- Run firefox and make sure it opens successfully.
Code:~/Flex/firefox/firefox- Run eclipse and make sure it opens successfully.
Code:~/Flex/eclipse/eclipse- The first time you run eclipse you will be asked to select a workspace path. Enter the following path when prompted (replacing YourUserName with your own).
Code:/home/YourUserName/Flex/workspace- Assuming no errors are displayed in the terminal you should now be able to install Flex Builder so make the bin file executable.
Code:chmod +x ~/Desktop/flexbuilder*.bin- And now start the installation. Make sure that firefox, eclipse and all java apps are closed before proceeding.
Code:~/Desktop/flexbuilder*.bin- When you are prompted to select the Flex Builder installation directory enter the following (replacing YourUserName with your own).
Code:/home/YourUserName/Flex/Flex_Builder- When you are prompted to select the 32-bit eclipse directory enter the following (replacing YourUserName with your own).
Code:/home/YourUserName/Flex/eclipse- Follow the on-screen instructions to complete the installation. The JSEclipse plugin is optional but I chose to install it anyway.
- Now we need to copy the DEBUG flash plugin to the 32-bit version of firefox. This is different from the standard flash plugin.
Code:cp ~/Flex/Flex_Builder/Player/linux/install_flash_player_9_linux/libflashplayer.so ~/Flex/firefox/plugins- Edit the eclipse.ini file so that it always uses the 32-bit version of java.
Code:gedit ~/Flex/eclipse/eclipse.ini- Add the following commands to the ini file. Make sure to enter them on the first line. The instructions on Adobe's website will tell you to place it at the end of the file. IGNORE THOSE INSTRUCTIONS. If you place it at the end of the file it will have no effect. You must also enter the commands on two separate lines. If you enter it as one line it will have no effect either.
The resulting file would look something like this:Code:-vm /usr/lib/jvm/ia32-java-6-sun/jre/bin/java
Code:-vm /usr/lib/jvm/ia32-java-6-sun/jre/bin/java -showsplash org.eclipse.platform -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx256m- Click save and close gedit.
- Change back to your default jre using the path you wrote down earlier. You should probably update javaws as well just to be safe.
Code:sudo update-alternatives --set java /usr/lib/jvm/java-6-sun/jre/bin/java sudo update-alternatives --set javaws /usr/lib/jvm/java-6-sun/jre/bin/javaws- Now we're going to create an application launcher for Flex Builder on your development menu.
Code:sudo gedit /usr/share/applications/flexbuilder.desktop- Copy ALL of the following and paste it into gedit (replace YourUserName with your own).
Code:[Desktop Entry] Name=Adobe Flex Builder Comment=Flex Builder plugin for Eclipse IDE Exec=/home/YourUserName/Flex/eclipse/eclipse Icon=/home/YourUserName/Flex/eclipse/plugins/org.eclipse.platform_3.3.3.r33x_r20080129/eclipse48.png Terminal=false Type=Application Categories=Development; StartupNotify=true- Click save and close gedit.
- I would highly recommend restarting your pc at this point just to be safe.
- Now if everything went well you should be able to open Flex Builder from your Applications menu. Click on your Applications menu, select Development, and click Adobe Flex Builder.
- If it opens then you have one more step. We need to set the default browser to the 32-bit version of Firefox that you installed. Click on Window then click Preferences. Expand the General menu. Click on Web Browser. Check the box labeled 'Use external Web browser'. Click New. Enter the following information.
Code:Name: Firefox Location: /home/YourUserName/Flex/firefox/firefox Parameters: %URL%- Click OK. Check the box next to Firefox and click OK.
Update Flex and Air sdk
The following steps will walk you through the process of installing the latest versions of the Flex and Air sdk and how to enable them in Eclipse. Make sure to download both files to your Desktop folder.
- Download the latest Flex sdk from the nightly section.
- Download the latest AIR sdk.
- Extract the flex sdk.
Code:mkdir ~/Flex/latest_flex_sdk unzip -o -q ~/Desktop/flex_sdk*.zip -d ~/Flex/latest_flex_sdk- Extract the air sdk.
Code:tar --overwrite -xf ~/Desktop/AdobeAIRSDK*.tbz2 -C ~/Flex/latest_flex_sdk- Try to remove the adl_lin and adt_lin files if they exist. It's possible that they may not be present in that folder so don't worry if the commands below display any errors.
Code:rm ~/Flex/latest_flex_sdk/bin/adl_lin rm ~/Flex/latest_flex_sdk/bin/adt_lin- Create the new adl_lin and adt_lin files.
Code:rename s/adl/adl_lin/ ~/Flex/latest_flex_sdk/bin/adl rename s/adt/adt_lin/ ~/Flex/latest_flex_sdk/bin/adt- Create a symlink for the linux directory.
Code:ln -s ~/Flex/latest_flex_sdk/runtimes/air/linux ~/Flex/latest_flex_sdk/runtimes/air/Linux- Open Eclipse
- Click Window > Preferences
- Expand the Flex folder
- Click Installed Flex SDKs
- Click Add
- Enter /home/YourUserName/Flex/latest_flex_sdk as the location
- Enter Nightly as the name (if you don't plan on updating very often then just keep the auto-generated name)
- Click OK
- Check the box next to Nightly to use this version by default, then click Apply.
HELLO WORLD Air Application
- To create a new flex project click on File > New > Project...
- Click Flex Builder > Flex Project > Next
- Type a project name and then select Desktop Application.
- Click Finish.
- Click Yes if you are prompted to "Switch to Flex Development Perspective?"
- In the "Flex Navigator" pane, expand the src folder, right click on both files (.mxml and .xml) and select "Open with > Text Editor".
- Paste the following into the .mxml file replacing all of the existing content.
Code:<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="Hello World"> <mx:Style> WindowedApplication { background-color:"0x999999"; background-alpha:"0.5"; } </mx:Style> <mx:Label text="Hello World" horizontalCenter="0" verticalCenter="0"/> </mx:WindowedApplication>- In the .xml file select the code beginning with <title> and ending with </transparent>. Paste the following over the selected code.
Code:<title>Hello World</title> <systemChrome>none</systemChrome> <transparent>true</transparent>- Click save then click debug (or press F11). A new window should appear with Hello World in the title bar and centered in the body of the window.
Notes
If you discover that your mouse has a problem clicking on some of the Next and Finish buttons in Eclipse then simply click on the button to select it and then press enter. Not sure if I'm the only one experiencing this issue but if you do encounter this problem it's fairly easy to work around it.
Bookmarks