Whenever I tried to get CollabNet for Eclipse plugin working in Eclipse PDT, it always failed, yielding the error “Unable to load SVN client” upon any SVN activity. I did endless amounts of Googling to try to solve the problem, but always came to a brick wall.
The big problem here is that Eclipse is just too new for Ubuntu – even Jaunty. An apt-get install subversion on Jaunty Jackalope will install subversion 1.5.4, which just doesn’t work, and thats where the big problem lies. CollabNet for Eclipse categorically requires Subversion 1.6. Unfortunately the only solution I’ve come up with is to compile subversion and it’s javahl bindings yourself. I’ll try and remember all the steps I took to make it work.
First, download the latest subversion and subversion-deps tgz from http://subversion.tigris.org/. At time of writing they are here and here. Extract them both:
$ tar zxvf subversion-1.6.1.tar.gz $ tar zxvf subversion-deps-1.6.1.tar.gz $ cd subversion-1.6.1
You’ll need to install a couple of extra packages (this assumes you’re using Sun’s JRE), and assuming you already had subversion and libsvn-javahl already installed, uninstall a couple:
$ sudo apt-get install libssl-dev sun-java6-jdk g++ $ sudo apt-get remove subversion libsvn-javahl
Configure, make and install subversion. You can check it’s the right version too:
$ ./configure --disable-nls --enable-javahl --with-jdk=/usr/lib/jvm/java-6-sun-1.6.0.13 $ make $ sudo make install $ svn --version
Once that’s done, you’ll want to compile the javahl binding. Once installed, check it’s installed correctly too. It’s fairly likely the .so file will be in /usr/local/lib.
$ make javahl $ sudo make install-javahl $ sudo updatedb $ locate libsvnjavahl-1.so $ sudo ldconfig
Open your eclipse.ini, and after the -vmargs line, add:
-Djava.library.path=/usr/local/lib
replacing the path with the path where the libsvnjavahl-1.so with your correct path.
Now fire up Eclipse, go to Window > Preferences > Team > SVN. The SVN Interface should now say JavaHL (JNI) 1.6.1 and a revision, depending on the particular version of SVN you installed.
I think that’s all the steps I took, so I apologise if I missed something out – if I remember something I’ll add it in!
Update: Compiling javahl requires g++, so I added that into the apt-get install line.
Update 2: Missed out ldconfig after libraries creation.
Update 3: If you still have issues getting it to work, I recommend looking at http://subclipse.tigris.org/wiki/JavaHL, reading it carefully, especially the Troubleshooting on Linux section. The javahltests.jar JUnit tests that are provided on the page may be very handy when debugging problems!
I’m really growing to love