Subclipse on Ubuntu 64-bit

Only recently did I switch to using the 64-bit version Ubuntu. Turns out I am not alone to delay the switch to 64-bit, Java is also not quite ready to run with the big boys. But reverting to 32-bit Java on a 64-bit system creates problems with JNI dependent code such as Subclipse.

I tried running the 64-bit version of Sun's Oracle's Java and at first it seems to run fine. But when debugging remote embedded systems using Eclipse, GDB and cross-compilers it becomes unstable. And when you're busy debugging your code there is one thing you absolutely need: a stable development environment. So I switched back to using the 32-bit version. You can do that easliy on Ubuntu, just install the ia32-sun-java6-bin package instead of the ia32-sun-java6-bin one. After that, you have a stable development environment once again. Performance wise I am yet to discover any difference between the different Java versions.

Unfortunatly, the JNI dependent packages don't go with it as there is no alternative for the libsvn-java package. Well, actually there is but you cannot select it using apt-get or aptitude. We need to do this manually.

First thing we need to do is download a package from http://packages.ubuntu.com/lucid/i386/libsvn-java/download (replace lucid with the name of your version). Next we need to unpack that package, create a /usr/lib32/jni folder and copy the libsvnjava files into it.

Use the following commands to do all that:

wget http://security.ubuntu.com/ubuntu/pool/universe/s/subversion/libsvn-java_1.6.6dfsg-2ubuntu1.2_i386.deb
dpkg -x libsvn-java_1.6.6dfsg-2ubuntu1.2_i386.deb /tmp
sudo mkdir -p /usr/lib32/jni
sudo cp -P /tmp/usr/lib/jni/libsvnjavahl-1.so* /usr/lib32/jni

After the installation you can use the -D option to pass the new jni folder location to eclipse:

eclipse -Djava.library.path=/usr/lib32/jni

 

I have not tried using the openjdk-6 Java. Maybe they do have a stable 64-bit version.