Wednesday, February 23, 2011

Setting up Flex on Eclipse for Linux

For Long time I'm looking to switch over to Ubuntu, my favorite OS., but due to unavailability of flex builder for Linux I wasn't able to. Later after a long Google search, I came across following post by Nicholas, http://tboxmy.blogspot.com/2010/10/setting-up-flex-on-eclipse-for-linux.html.




Pre-installation checks: Have you installed Eclipse 3.5+ and Java Development Kit 1.5+

Step 1. Download the fb4linux files in 4 parts from http://code.google.com/p/fb4linux/downloads/list

  • FB4Linuxaa
  • FB4Linuxab
  • FB4Linuxac
  • FB4Linuxad
Merge them together into a BZIP2 format and extract using the command prompt at the terminal. At the folder where you downloaded the 4 files, just type

cat FB4Linux* >FB4Linux.tar.bz2
bunzip2 FB4Linux.tar.bz2
tar -xvf FB4Linux.tar

I renamed the folder to Adobe_Flash_Builder4 since I did not want spaces between the folder name.

Step 2. Download the eclipse plugin for FB4Linux from http://www.brighthub.com/hubfolio/matthew-casperson/media/p/78806.aspx

Unzip the file ecplise and copy the plugins to /usr/lib/eclipse/plugins

The plugins are;
com.adobe.coldfusion.rds.client_1.0.266425.jar
javax.wsdl_1.6.2.v200806030405.jar
org.apache.commons.lang_2.3.0.v200803061910.jar
org.apache.xerces_2.8.0.v200803070308.jar
org.apache.xml.resolver_1.1.0.v200806030311.jar

Step 3. Start Eclipse and apply the plugins.

In Eclipse select Window->Preferences->General->Capabilities and make sure that the Classic Update option is checked.
Click Help->Software Updates->New Feature to Install.
Click the New Local Site button, and type in the location where you extracted FB4Linux in step 1 (you will need to specify the eclipse subdirectory to be specific).
With the Adobe Flash Builder 4 site selected, click the Finish button. You will be asked which features to install. Tick the Adobe Flash Builder 4 feature and click Next.
Accept the terms and click the Next button and click Finish button.

Restart Eclipse.

Step 4: Install the Flex SDK from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4
Download and extract a copy of the Flex SDK from Adobe into a folder flex4.1.0

Set Eclipse to use the Flex SDK by right clicking on your Flash project and selecting Properties. Select the ActionScript Compiler option.
Click the Add button to add the location of the Flex SDK you have extracted.


After getting everything done, I found difficult set debugging of flex code. Then I got help from Arul Raj in http://www.arulraj.net/2010/08/flash-player-debugger-in-ubuntu.html


Here the steps for how to install debug flashplayer in ubuntu 10.04 firefox 3.6.
Steps:
  • Download the debugger version from here . Or Download this Zip file for Linux http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_plugin_debug.tar.gz
  • Extract that zip file and get that “libflashplayer.so”
  • Goto this folder “/usr/lib/mozilla/plugins” then copy and  paste that libflashplayer.so here. Then Delete the shortcut named “flashplugin-alternative.so”
  • Create a mm.cfg file in your home directory. For example /home//mm.cfg
  • The mm.cfg file is look like the below
ErrorReportingEnable=0
TraceOutputFileEnable=1
MaxWarnings=0
Then restart your firefox.


After all this, my flex web application runs smoothly in linux. But when I try to run a AIR application, got the error, "! ApolloLaunchDelegate.dirDoesNotExist!". Then I got reference from, zrong's Blog, http://zengrong.net/post/1024.htm 


The reason is downloaded from the opensource.adobe.com FlexSDK does not include Linux compiler, you must use the Linux version of the AIR SDK. 
According to their needs and install the AIR runtime version, from the following link to download: 
AIR SDK 2 
Unzip the downloaded content and coverage to your Flex SDKS folder. 
At the same time, should be installed AIR Runtime .





Thanks for the people who helped me in this process.. Long life bloggers..