Getting Subclipse to work with Eclipse v3.4 Ganymede on Ubuntu Desktop

finally i moved to Ganymede on my laptop. well, actually i am using the Eclipse PHP Development Tools also known as the PDT which is based on Eclipse version 3.4. nothing to blame here, everything went smoothly. the second step after each install of Eclipse is the installation of Subclipse to work using Subversion repositories. same goes here. but this time i got an error trying to check out my first repository:

Unable to load default SVN Client

what went wrong? at least i installed every required and recommended component of Subclipse. to solve the problem i did a quick search on Google and found out that at least a JavaHL or SVNKit adapter must be present to use Subclipse. but i had them present! at least in Eclipse… seconds later i realized that my underlying Ubuntu installation might not have installed the JavaHL adapter itself. and guess what? of course it lacked the appropriate package:

libsvn-java

i then just installed this package and everything went … still wrong. what? yeah, it went wrong. because you have to tell Eclipse to use the JavaHL component. when installing using synaptic JavaHL is placed as a shared object in /usr/lib/jni/ – which is not checked by Eclipse. tell it to use this directory by changing options in the eclipse.ini:

$ sudo vi /usr/local/pdt/eclipse.ini

you have to add a java.library.path option:

-Djava.library.path=/usr/lib/jni

my eclipse.ini looks like that:


$ cat /usr/local/pdt/eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Djava.library.path=/usr/lib/jni
-Xms40m
-Xmx256m

you can then test if it worked by checking the Eclipse preferences under Team > SVN. the SVN interface box must state that the JavaHL (JNI) client is being used.

to sum it up: for using Sublipse with Eclipse Ganymede on Ubuntu you just have to:

  1. install Eclipse using Sun’s Java Runtime Environment
  2. install Subclipse
  3. install Ubuntu’s libsvn-java package
  4. tell Eclipse to use the JavaHL binding
  5. check out your favorite SVN repository! :)

happy coding!

This entry was posted in my beloved code, open source and free software and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Advertising

5 Comments

  1. Posted January 23, 2009 at 6:53 pm | Permalink

    You figured it all out but wanted to let you know we have a wiki page to help explain this too:

    http://subclipse.tigris.org/wiki/JavaHL

  2. Posted January 23, 2009 at 10:46 pm | Permalink

    Hello,

    As you’ve mentioned one may also use SVNKit that is easier to install comparing to JavaHL library – use SVNKit update site in Eclipse update manager (Help | Software Updates), site URL is http://eclipse.svnkit.com/1.2.x – from update site one could install SVNKit plugin and after restarting Eclipse Subclipse will automatically use it.

    Thanks,
    Alexander Kitaev.

  3. stotti
    Posted January 25, 2009 at 1:50 pm | Permalink

    hi Mark, hi Alexander,

    thank you for your comments. incidentally i found the very helpful wiki page after writing this article. nevertheless it has some benefits for Ubuntu users so i guess it has some right to exist. ;)
    Alexander, i have no experience with SVNKit but i will give it a try and possibly blog about this as well.

    Best regards
    Stotti

  4. Posted March 13, 2009 at 1:09 pm | Permalink

    I had both installed, too (svnkit/libsvn-java) and it did not recognize any.

    adding the line into my eclipse.ini helped. thanks a lot :)

  5. stotti
    Posted March 13, 2009 at 1:32 pm | Permalink

    Thanks for the reply, Günter. You’re welcome!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>