mohangk.org/blog

Thoughts, somewhat explained

Ubuntu Subclipse woes – use JavaHL bindings

| 10 Comments

We use a combination of Ubuntu + Eclipse + PHPEclipse + Subclipse in the office as a stock standard developer machine setup. Developers are free to make changes, but when in doubt this is what they get.

Over the pass couple of months though, as we have added more code into the repository we noticed that the Eclipse had really been slowing down and crashing frequently, primarily due to large memory consumption. However , developers who had dropped the Subclipse plugin and resorted to the command line client (which is the way I like it ;-) ) did not seem to be having any issues.

We had until then also been using the  packaged version of eclipse that was provided by Ubuntu. Seeing that there was a new version of Eclipse 3.4 and Subclipse 1.4 out we decided to see if there was a way to solve this issue and upgrade our default install.

Long story short, it turns out that the Subclipse can either be made to use SVNKit which is a pure Java implementation  or JavaHL which is a wrapper for the native C library. Turns out we had been using SVNKit all this while. No prize for guessing which one is faster and handles large repositories better ;-) .

The problem though (as identified in the FAQ entry) that since the JavaHL requires local library support you need to make sure that the version of Subclipse you are using supports the version you have installed in your machine. With Ubuntu 8.04, the  packaged version is libsvn-javahl_1.4.6 , which means that you are stuck with Subclipse 1.2, as Subclipse 1.4 requires the  libsvn from Subversion 1.5. Looking through Google I stumbled upon Basilisk’s blog entry that details the problem out and enumerates possible solutions. I choose the option of running Subclipse 1.2.

So a quick recipe to getting Eclipse 3.4 (directly from the download site) + Subclipse 1.2 with the JavaHL binding running on Ubuntu 8.04 is as follows:

1. In a terminal window, do the following. This line of command is used for installing java6-jre. You need to use the Sun provided java for things to work properly.

sudo apt-get install sun-java6-jre

2. Then type this to install the libsvn-javahl library that will be used by Subclipse.

sudo apt-get install libsvn-javahl

3.Type the following to set the Sun-Java as your default JVM. This will make sure that whenever an application looks for the java command it will be using the Sun provided version.

sudo update-java-alternatives -s java-6-sun

4. Then go to the eclipse site http://www.eclipse.org – got to the download section and (http://www.eclipse.org/downloads/) and download the Eclipse package relevant for your use case. For my case I downloaded Eclipse Classic from http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4-linux-gtk.tar.gz

5. Save it into your destination folder. For my case I saved it into my home dir. (And that is what the instructions will assume from this point onwards).

6. The in a terminal do the following. Please note that the path to cd into (in the example’s case it is ~) should be replaced with the path that you actually saved the download into during Step 5.

cd ~
tar -xvzf eclipse-SDK-3.4-linux-gtk.tar.gz

7. If you type ‘ls’ now there should be an additional folder called ‘eclipse’.

8. Now we need to edit the eclipse.ini file which is in the newly created eclipse folder and add a single line at the end of the file as follows “-Djava.library.path=/usr/lib/jni” I found out that this is so that the JavaHL libraries are picked up by Eclipse.

gedit ~/eclipse/eclipse.ini

Original text:
-startup
plugins/org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.100.v20080606
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m

After editing:
-startup
plugins/org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.100.v20080606
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m
-Djava.library.path=/usr/lib/jni

9. Now you can start Eclipse by clicking on the Eclipse icon with the eclipse folder.

10. Startup Eclipse.

11. Click on Help->Software Updates->Available Software from file menu in Eclipse.

12. Click on the “Add Site” button.

13. Enter a name i.e subclipse, and the URL: http://subclipse.tigris.org/update_1.2.x (Thanks Basilisk!) (Note the link to ver 1.2 not 1.4)

14. Click on “Finish”.

15. A list of features will be presented, open the list and check the one labeled “subclipse”. There will be optional packages available as well. I was only interested in the core subclipse components.

16. Click on “Next”

17. Keep clicking through till your done.

18. The install will ask you to restart your eclipse, choose yes and continue.

19. Upon Eclipse restarting go to Menu item Window>Preferences. Once the pane Pops up select the item Team > SVN. The preference should come up and there should not be any errors. If errors come up it is probably caused because for some reason your default java is still not pointing to the sun java. For more info on this you can refer to this ubuntu forum discussion.

Anyway – I hope somebody finds this useful. Feel free to add amendments and corrections in the comments.

10 Comments

  1. > No prize for guessing which one is faster and handles large repositories better
    Hello! I can’t say I like the above statement :) , but do you have any exact issues to report when SVNKit Adapter was used? Please also note, that using Subclipse 1.2 will not allow one to use Subversion 1.5 features.

    Alexander, SVNKit developer :)

  2. Hello Alexander,

    Thanks for dropping by. I was being flippant with that statement my statement and I apologise for not backing it up with more concrete data. I did not keep enough data to pin point to an exact issue, but what we did experience is that when using the SVNKit adapter the memory consumption was noticeably higher (in comparison with the JavaHL adapter ) So much higher that it Eclipse kept crashing. Yes I do understand that using Subclipse 1.2 limits us to Subversion 1.4 features. We will probably move to Subclipse 1.4 when Ubuntu Intrepid Ibex is out (which I believe will ship with subversion 1.5). I will also probably give SVNKit another run and see if I can come up with more useful data for you.

    Thanks again for dropping by.

    Mohan

  3. Pingback: SVN + Eclipse 3.4 + Ubuntu 8.04 « Victor V. Serta’s Tech Blog

  4. Updated 5/20/2009:

    Eclipse PDT 2.0 using SVNKit 1.2.2 with Subclipse 1.4.x is still slow. While the CLI svn client takes less than 5 seconds for an update with very little network bandwidth and just a few blinks of HDD, Subclipse takes about 15 seconds with saturated network bandwidth (DSL 768Kb/s) during the whole time with the HDD crunching like crazy (click..click…click…)

    Anyway, changed to Subclipse 1.2.x with JavaHL, as fast as CLI.

  5. free tattoo sleeve designs,

  6. Thanks for your posting. One other thing is that if you are selling your property all on your own, one of the difficulties you need to be conscious of upfront is just how to deal with home inspection reviews. As a FSBO retailer, the key about successfully switching your property and saving money on real estate agent commissions is awareness. The more you recognize, the more stable your property sales effort are going to be. One area that this is particularly essential is reports.

  7. Today, with all the fast way of life that everyone leads, credit cards have a huge demand throughout the economy. Persons out of every discipline are using the credit card and people who aren’t using the card have made up their minds to apply for one in particular. Thanks for expressing your ideas in credit cards.

  8. Your post is great. It is very descriptive and I am sure it can attract ton of readers and reviewers. Keep doing great job!

  9. Nice post. I was checking continuously this blog and I’m impressed! Very helpful information particularly the last part :) I care for such information much. I was seeking this certain information for a very long time. Thank you and good luck.

  10. ill for surebe bookmarking this side.

Leave a Reply

Required fields are marked *.

*