26 Sept 2011

Install maple-ide on 64 bit linux

The maple IDE is only offered as 32Bit java binary/bytecode. On a 64Bit linux with a default java installation maple-ide will refuse to start with the following error:

$ ./maple-ide 
java.lang.UnsatisfiedLinkError: /mnt/aaa/bin/maple-ide-v0.0.12/lib/librxtxSerial.so: /mnt/aaa/bin/maple-ide-v0.0.12/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /mnt/aaa/bin/maple-ide-v0.0.12/lib/librxtxSerial.so: /mnt/aaa/bin/maple-ide-v0.0.12/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123)
    at processing.app.Editor.populateSerialMenu(Editor.java:795)
    at processing.app.Editor.buildToolsMenu(Editor.java:612)
    at processing.app.Editor.buildMenuBar(Editor.java:413)
    at processing.app.Editor.(Editor.java:187)
    at processing.app.Base.handleOpen(Base.java:608)
    at processing.app.Base.handleOpen(Base.java:573)
    at processing.app.Base.handleNew(Base.java:475)
    at processing.app.Base.(Base.java:245)
    at processing.app.Base.main(Base.java:149)

You will be able to select a folder for your sketches and then the application will crash.

The problem can be solved by installing the 32Bit version of Java (i chose the sun/oracle one):

$ sudo apt-get install ia32-sun-java6-bin

Then modify the startup script maple-ide to point to the appropriate java installation. Adjust JAVA_HOME and the PATH environment variables:

#!/bin/sh
APPDIR="$(dirname -- "${0}")"

cd $APPDIR

# /usr/lib/jvm/ia32-java-6-sun/jre/bin/
export JAVA_HOME=/usr/lib/jvm/ia32-java-6-sun/jre
export PATH=$JAVA_HOME/bin:$PATH

for LIB in \
    java/lib/rt.jar \
    java/lib/tools.jar \
    lib/*.jar \
    ;
do
    CLASSPATH="${CLASSPATH}:${APPDIR}/${LIB}"
done
export CLASSPATH

LD_LIBRARY_PATH=`pwd`/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

export PATH="${APPDIR}/java/bin:${PATH}"

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base