Flex 3 Development on Ubutu Linux
April 12th, 2008
I generally work on windows but have Ubuntu running on my laptop aswell for those times I get sick of windows and its slow booting in particular. Today I decided to try some Flex development on Ubuntu. Had a few slight problems to overcome so decided to stick the details down here in case I need them again or anyone else has similar issues. Plenty of others have been through this and I have linked to their info where appropriate.
Firstly you need the Flex 3 SDK from the adobe site. Same package for all platforms. Download it and extract it whereever you like, in my case i put it in my home directory in a flex_3_sdk folder.
If you want you can get the flex builder plugin for eclipse which I suppose is useful if you’re doing some serious scale development but I couldn’t be bothered, any text editor on my system will do the job after all flex files are just xml. I’m using the SCITE editor at the moment.
Once I have my mxml file ready I need to call the mxmlc compiler in the flex_3_sdk/bin folder. You can do this the long way e.g.
./flex_3_sdk/bin/mxmlc myflexfile.mxml
or you could just edit your bashrc to add a shortcut alias to mxmlc e.g.
alias mxmlc='flex_3_sdk/bin/mxmlc myflexfile.mxml'
- now you can just call mxmlc with the filename.
Here I hit a problem I couldn’t figure out, after calling the compiler an error message appeared “Segmentation Fault - core dumped”. After a bit of googling it seems that the segmentation fault error is caused by the java runtime and thanks to this explanation and solution I saw that I needed to get the Sun Java runtime as opposed to the default one that comes with Ubuntu. The quickest way to do this was just to use the package manager to get and install the Sun Java 6 JDK and runtime. Once you have the latest Sun version installed I edited the mxmlc file to point to the new java location
/usr/lib/jvm/java-6-sun/bin/java $VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" "$@"
And finally my flex file compiled and I got my swf which I duly opened in firefox and had the joy of seeing a label with “hello larry” on it
2 Comments Add your own
1. Hunter Loftis | August 15th, 2008 at 7:21 am
Hi Larry,
Thanks for your summary of the process… I used it as a guide in setting up my own development pipeline under Kubuntu. Something I found that may help in revision is based on:
https://help.ubuntu.com/community/AzureusHowTo
Which shows how to update application alternatives in Ubuntu. It’s a cleaner way to set Sun Java 6 as the default java provider for your system, so you don’t have to edit the mxmlc script (and also so other related software, like Eclipse, will work better).
Cheers!
Hunter
2. Patrick Horgan | August 25th, 2008 at 11:05 pm
I had the same problem, and the Sun JDK was installed! I went into my bashrc and put the path to it at the head of my path and now it finds the one I want.
Patrick
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed