UPDATE: I found an easier solution to the problem (described in my forum post following this one).
I'll leave this post for the more adventurous users out there.
Originally Posted by
peterdm
This is how I got JavaHL to work:
I presume you've installed Eclipse Ganymede by hand, since it's not in the Ubuntu repos. The problem comes from the fact that the subclipse plugin
requires subversion 1.5.x installed, while Ubuntu 8.04 comes with subversino 1.4.x. So if we want it to work, we'll have to uninstall subversion from the Ubuntu repos and compile subversion ourselves.
Let's assume you have Eclipse Ganymede installed in /usr/share/eclipse, and that you're using a JDK installed in /usr/lib/jvm/java-6-openjdk.
- In order to be able to compile subversion, you need to make sure the following packages installed: libapr-1, libapr1-dev, libaprutil1, libaprutil1-dev
Code:
sudo apt-get install libapr-1 libapr1-dev libaprutil1 libaprutil1-dev
- Make sure the Ubuntu package libsvn-java is not installed, this is the one we're about to compile for ourselves in the following steps
- Now download the subclipse sources and untar them (e.g. in your user's home)
Code:
tar -xvjf subversion-1.5.1.tar.bz2
- Enter the directory, configure and build javahl (as normal user) and install (as super user)
Code:
cd subversion-1.5.1
./configure --enable-javahl --with-jdk=/usr/lib/jvm/java-6-openjdk/
make javahl
sudo make install-javahl
- Now the javahl libraries are installed in /usr/local/lib but you probably want them in /usr/lib/jni.
Code:
sudo cp /usr/local/lib/libsvnjavahl-1.* /usr/lib/jni/
sudo cp /usr/local/lib/svn-javahl/svn-javahl.jar /usr/share/java/
The first command has not copied the symbolic links correctly, it has replaced them by copies of the actual files. This works, but you may want fix the links. - For some reason Eclipse still doesn't pick them up now, so we'll have to be a bit more persuasive. You should add a line -Djava.library.path=/usr/lib/jni to the file /usr/share/eclipse/eclipse.ini (edit as super user) after the -vmargs line
- Install http://subclipse.tigris.org/update_1.4.x as Eclipse update site, and install subclipse with the javahl adapter
Now you should have JavaHL working in Eclipse Ganymede! Double-check by opening Window->Preferences->Team->SVN, and select JavaHL under "SVN Interface" section. It should say "JavaHL (JNI) 1.5.1..." instead of the dreaded "JavaHL(JNI) Not Available"!
Hope this helps,
Peter
Thx for the info Peter. This has worked for me with some differences:
I did one more install through apt-get, as noted by Mwiti (thx!):
Code:
sudo apt-get install libsvn-dev
As i didn't have any jni-libraries installed I had to create the jni directory before I did make install
Code:
sudo mkdir /usr/lib/jni
sudo make install-javahl
(To be complete, I actually executed the normal target instead: sudo make install, but target install-javahl should be sufficient.)
Afterwards I didn't have to edit the eclipse.ini (I actually did add this but without the desired result.), but instead create links in /usr/lib to every file in the /usr/lib/jni directory.
Code:
cd /usr/lib
sudo ln -s jni/libsvnjavahl-1.a
sudo ln -s jni/libsvnjavahl-1.la
sudo ln -s jni/libsvnjavahl-1.so.0.0.0
sudo ln -s libsvnjavahl-1.so.0.0.0 libsvnjavahl-1.so
sudo ln -s libsvnjavahl-1.so.0.0.0 libsvnjavahl-1.so.0
After the linking Subclipse picked up JavaHl.
Installed on:
Kubuntu Hardy 8.04 amd64
Eclipse 3.4 Ganymedes
Bookmarks