Ubuntu’s default JRE doesn’t like Flex SDK

Posted on December 6, 2006 | 9 comments

I downloaded the latest SDK of Flex to try out coding Flex in Ubuntu (6.06).

Here are the basic steps to try it out:
Download Flex 2 SDK for linux
Extract package to a directory (/home/renaun/Desktop/flexsdk/)
Create simple mxml file called helloworld.mxml
Run the following command:
>/home/renaun/Desktop/flexsdk/bin/mxmlc -o helloworld.swf helloworld.mxml

At this point I got a segmentation fault. Looking at the java version that comes with Ubuntu you see its a gij 1.4.2 JRE.

>java -version
java version “1.4.2″
gij (GNU libgcj) version 4.1.0 (Ubuntu 4.1.0-1ubuntu8)

To fix the segmentation fault I had to download a different JRE from Sun. I downloaded both the 1.5.0_10 and 1.4.2_13 self-extracting JREs. I extracted both in the Desktop folder. To change which java executable the mxmlc will run you need to modify the mxmlc shell script it self. On my install it was located at “/home/renaun/Desktop/flexsdk/bin/mxmlc”.

I edited the last line in the mxmlc shell script from:
java $VMARGS -jar “$FLEX_HOME/lib/mxmlc.jar” +flexlib=”$FLEX_HOME/frameworks” $*
/home/renaun/Desktop/jre1.5.0_10/bin/java $VMARGS -jar “$FLEX_HOME/lib/mxmlc.jar” +flexlib=”$FLEX_HOME/frameworks” $*

And that fixed the problem (both 1.5.0_10 and 1.4.2_13 work). Now onto some ant build scripts and eclipse integration….

  • Pingback: Wheeler Street » Blog Archive » Collecting Flex 2 on Linux Information

  • pan69
  • http://www.renaun.com Renaun Erickson

    Pan thanks for the link, the flex2ant provides a nice plugin for Ant to recognize mxmlc as a valid build target.

  • milan

    I’ve had the same problem. thanks, it really works! br Milan

  • http://www.mocktech.com/ mock

    thanks for the 411. this hooked me up too.

  • Corba

    Thanks. I upgraded my Ubuntu 6.10 to jdk1.5.0_11 and the samples all build without segfaults. Whew!

  • Priyanka

    Hi, I encountered the same problem. This post helped me get over it.

    Thank you so much.

  • Chris Pelling

    Thank you! I too was having this exact problem with the default version of Java that comes with Ubuntu 7.10 Gutsy Gibbon, GCJ version 4.2.1:

    $ java -version
    java version “1.5.0″
    gij (GNU libgcj) version 4.2.1 (Ubuntu 4.2.1-5ubuntu5)

    Downloading and using the latest JRE from Sun fixed it.

  • http://develobert.blogspot.com joebert

    It’s amazing that after all this time, a version of Java that doesn’t cooperate with Flex is still shipping with Ubuntu.

    I’m using Ubuntu 7.10 (Gutsy), and JRE 1.6 is what works at the moment.

  • dgandhi

    It’s amazing that after all this time, a version of Java that doesn’t cooperate with Flex is still shipping with Ubuntu.

    Since Ubuntu does not install anything that is not free[as in speech] by default, and since Adobe and Sun don’t allow their software to be installed without EULAs, it’s not really Ubuntu’s choice until Adobe decides to support gij.

    Synaptic has it in the database, and it works fine, it’s just illegal to install without user interaction.