Sunday, December 28, 2008

Ubuntu 8.04 64 bit, Eclipse 3.4, Subclipse 1.4.7 and Subversion 1.5

How to get these working together ?
Firstly, it's incredible that such a simple thing requires such a big amount of research, trial and error and frustration when should work out-of-the-box.
I'm writing this post hoping to save somebody else precious development time.

Introduction
Subclipse 1.4.7 requires Subversion 1.5 which is not available in normal Ubuntu repositories.
Eclipse just crashes using other combinations, in this environment.

Subversion 1.5
Install subversion 1.5 from Ubuntu backports. Just download the required packages and install them, there's no need to enable backports repository just for this.
Download the following packages:
  • subversion (> 1.5)
  • libsvn1 (>1.5)
  • libsvn-java (>1.5)
and install them using dpkg, for example in 64 bit

$ sudo dpkg --install libsvn-java_1.5.1dfsg1-1ubuntu2_amd64.deb \
libsvn1_1.5.1dfsg1-1ubuntu2_amd64.deb \
subversion_1.5.1dfsg1-1ubuntu2_amd64.deb

Subclipse 1.4.7
Add http://subclipse.tigris.org/update_1.4.x site to Eclipse and install Subclipse 1.4.7, Subversion Client Adapter 1.5.2 and Subversion Native Client Library Adapter (JavaHL) 1.5.5

Configuring Eclipse 3.4
If you try to use Subversion in Eclipse you will receive and error, because the Subversion JNI libraries are not detected.
To achieve thisd you have to edit eclipse.ini (the path depends on where you've decided to install it, as it's not installed from deb packages)
Add these two lines (this is the little magic)

-showsplash
org.eclipse.platform
-vmargs
-Djava.library.path=/usr/share/java/
-Djava.library.path=/usr/lib/jni/
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m

and, after restarting Eclipse, you will be able to use Subversion.
Verify that under SVN Interface the correct JavaHL version is detected in Window -> Preferences -> Team -> SVN.

No comments: