While installing the subversion plugin Subclipse in the Eclipse IDE I came across a problem. Subclipse uses "JavaHL (JNI)" to interface with subversion by default. This default setting generates an error when accessing the "Window->Preferences->Team->SVN" preferences:
Failed to load JavaHL Library. These are the errors that were encountered: no libsvnjavahl-1 in java.library.path no svnjavahl-1 in java.library.path no svnjavahl in java.library.path java.library.path = /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/client::/ usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386::/usr/lib/firefox:/usr/lib/ firefox/:/usr/java/packages/lib/i386:/lib:/usr/lib
NOTE: as per the error message I am using Sun Java on my system.
This error does not seem to affect the basic subversion functionality (eg, checkout, commit, merge, etc.) and only appears when accessing the SVN preferences. However I have a custom subversion config I like to use in PHP development and I need to be able to access the SVN preferences.
The simplest way to bypass this issue is to select the "SVNKit (Pure Java)" in the "SVN interface" section of the SVN preferences. However if you require and/or desire the JavaHL subversion interface read on for a fix.
The Debian/Ubuntu package libsvn-java has the libsvnjavahl-1.so file that is required by JavaHL subversion interface. Install libsvn-java by typing the following into a command line:
sudo apt-get install libsvn-java
Restart Eclipse.
After installation is complete the required file (libsvnjavahl-1.so) is installed into the /usr/lib/jni directory. Default installations of Eclipse will pick this directory up automatically. Non-standard installation, such as ones installed by hand, will not find the required file.
I need to tell Eclipse where to find libsvnjavahl-1.so for non-standard installations. The error message indicates the required file cannot be found in the paths defined by java.library.path. We can either place the file (via symlink) into one of the specified paths OR set the java.library.path to point to the /usr/lib/jni directory. Using a symlink is viable however future upgrades of java may cause the installation to break. As illustrated below I have chosen to overwrite the java.library.path variable.
This solution affects the Eclipse installation on a per-user basis. Changes made here will not effect anyone else using Eclipse. To over-ride the java.library.path variable we will need to create a file called eclipserc in the .eclipse directory:
gedit ~/.eclipse/eclipserc
NOTE: The ~/.eclipse directory is created when Eclipse is first run.
Add the following line to ~/.eclipse/eclipserc:
VMARGS="-Djava.library.path=/usr/lib/jni"
Save the file and close it. Restart Eclipse and JavaHL will no longer generate error messages when accessing the SVN preferences.
http://subclipse.tigris.org/faq.html#get-javahl
http://svn.collab.net/repos/svn/trunk/subversion/bindings/javahl/README
http://packages.ubuntu.com/cgi-bin/search_contents.pl?searchmode=filelis...
http://ubuntuforums.org/archive/index.php/t-190384.html
http://www.nileshk.com/node/59
Comments
Using Pure Java interface
If you are having troubles with the JavaHL there is a way not to use it. You just need to install the SVNKit from the same update site as Subeclipse. that enables the option to use Pure JAVA Interface under Window>Preferences>Team>SVN > SVN Interface, just change it to that, its slower but it works.
Not Working for me...
Im using Ubuntu 9.10 and Eclipse 3.3 Europa (I need europa since its the only compatible with flexbuilder). I tried this but apparently the eclipse.ini is not being loaded when eclipse initializes. I already checked and this is the only eclipse.ini file in the entire disk.
this is my ini file:
-showsplash
org.eclipse.platform
-vmargs
-Djava.library.path=/usr/lib/jni
-Xms512m
-Xmx1024m
The Libraries are indeed in /usr/lib/jni but still getting the error.
I installed the FlexBuilder plugin to that eclipse, maybe that's causing some issue.
Any ideas??
Post new comment