Today I reinstalled my laptop with Ubuntu 9.04 (64bit version) and it runs like a charm.

Now I am reinstalling all the things I need for work, and of course eclipse with subclipse plugin.
Facing the usual problem with JavaHL, this time I wanted to fix it; because on OSX/Linux if you run different versions of command line svn tool and in eclipse (SVNKit), you can get into errors due to version mismatch between of the supported meta files.
Having eclipse to work with JavaHL libraries matching your svn installation will prevents this problem. So a solution is to build Subversion and the JavaHL libraries, and if you need the command line, use the one you built that is compatible to the JavaHL libraries used by eclipse.

Here the steps I made.

First of all, install the dependencies. From an almost new ubuntu 9.04 installation I installed following stuff:

$ sudo apt-get install libapr1 libaprutil1 libtool autoconf automake autotools-dev g++ gettext libneon27-dev sun-java6-jdk libapr1-dev libaprutil1-dev

Then download and compile

$ wget http://subversion.tigris.org/downloads/subversion-1.6.2.tar.bz2
$ tar xvjf subversion-1.6.2.tar.bz2 

$ cd subversion-1.6.2

$ make clean
$ ./autogen.sh 
$ ./configure --with-ssl --enable-javahl --with-jdk=/usr/lib/jvm/java-6-sun/
$ make
$ sudo make install

$ make javahl
$ sudo make install-javahl

Check svn command line, and libraries:

$ svn --version
svn, version 1.6.2 (r37639)
   compiled May 13 2009, 18:09:57

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

$ ls -l /usr/local/lib/ | grep javahl
-rw-r--r-- 1 root root  6723260 2009-05-13 18:14 libsvnjavahl-1.a
-rwxr-xr-x 1 root root     1629 2009-05-13 18:14 libsvnjavahl-1.la
lrwxrwxrwx 1 root root       23 2009-05-13 18:14 libsvnjavahl-1.so -> libsvnjavahl-1.so.0.0.0
lrwxrwxrwx 1 root root       23 2009-05-13 18:14 libsvnjavahl-1.so.0 -> libsvnjavahl-1.so.0.0.0
-rwxr-xr-x 1 root root  2633841 2009-05-13 18:14 libsvnjavahl-1.so.0.0.0
drwxr-xr-x 3 root root     4096 2009-05-13 18:14 svn-javahl

At this point, when you run eclipse, you need to specify where the JavaHL libraries are located:

cd /path/to/eclipse
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
./eclipse

Checkit (Windows>Preferences>Team>SVN):

JavaHL working!

Works!

Update

If you plan to uninstall subversion, it may be a good idea to use the --prefix=/usr/local/subversion-1.6.2 in order to easier locate files later. Of course you need to change paths for libraries when indicating them to eclipse, and update $PATH and $MAN_PATH to find for commands and manual pages.
So, my configure command today would be:

./configure  --with-ssl --enable-javahl --with-jdk=/usr/lib/jvm/java-6-sun --prefix=/usr/local/subversion-1.6.6/

In this way I can just remove /usr/local/subversion-1.6.6 to clean up my system.

My corresponding eclipse script is:

#!/bin/bash

cd ~/opt/eclipse
export LD_LIBRARY_PATH=/usr/local/subversion-1.6.6/lib:$LD_LIBRARY_PATH
./eclipse

and my manpath at ~/.manpath is:

# type "man 5 manpath" to see manual page about the format for this file.
# see /etc/manpath.config for additional examples.

MANDATORY_MANPATH /usr/local/subversion-1.6.6/share/man
MANPATH_MAP /usr/local/subversion-1.6.6/bin /usr/local/subversion-1.6.6/share/man

and my $PATH variable is including /usr/local/subversion-1.6.6/bin


3 Responses to “Making Eclipse JavaHL working, recompiling Subversion from the sources”  

  1. 1 Luigi

    Building using BerkeleyDb

    Download BerkeleyDb from http://www.oracle.com/technology/software/products/berkeley-db/index.html
    tar xvzf db-4.7.25.tar.gz
    cd db-4.7.25/
    cd build_unix/
    ../dist/configure
    make
    make install
    sudo make install

    Download subversion from http://subversion.tigris.org
    tar xvjf subversion-1.6.3.tar.bz2
    cd subversion-1.6.3/
    ./autogen.sh
    ./configure –with-ssl –enable-javahl –with-jdk=/usr/lib/jvm/java-6-sun –with-berkeley-db=db.h:/usr/local/BerkeleyDB.4.7/include:/usr/local/BerkeleyDB.4.7/lib:db-4.7 –prefix=/usr/local/subversion-1.6.3
    make
    sudo make install
    make javahl
    sudo make install-javahl

  2. 2 Mike

    Thanks for this article !

  1. 1 Windows to Linux transition « Kodeplay – Software Development | Ecommerce | Web 2.0 | Web Design


Leave a Reply

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


Current day month ye@r *


Calendar

May 2009
M T W T F S S
« Apr   Jun »
 123
45678910
11121314151617
18192021222324
25262728293031

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening