Using SVN in eclipse on Mac OS X

After upgrading subversion client my eclipse could not find javahl bindings any more, because i previously installed the CollabNet ones, which are currently available for subversion 1.6.x only. The bad thing about this is Subclipse does not work any more, until you’ll install these libraries using the following solutions.

There may be one for macports as well, but i’m using homebrew and nothing else any more :-)

Installing through homebrew is not as easy as installing through macports because they are not available as single package, but you can add a --java option to the homebrew command to build required javahlbinding together with subversion. This will show up the following warning, because you should use a universal build.

$ brew install --java subversion
==> Downloading
Warning: A non-Universal Java build was requested.
To use Java bindings with various Java IDEs, you might need a universal build:
 brew install subversion --universal --java


You can check available install options on each formula by using brew options command. Use brew options subversion to check install options of subversion.

And now install our subversion package

$ brew install --universal --java subversion
==> make
==> make install
==> make tools
==> make install-tools
==> make javahl
==> make install-javahl
==> Caveats
You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

On my Mac OS X Mountain Lion the folder /Library/Java/Extensions already exists, so i linked these 2 javahl libraries into that folder:

$ cd /Library/Java/Extensions
/Library/Java/Extensions $ sudo ln -sf /usr/local/lib/libsvnjavahl-1.dylib
/Library/Java/Extensions $ sudo ln -sf /usr/local/lib/libsvnjavahl-1.jnilib
/Library/Java/Extensions $ ls -l
total 16
lrwxr-xr-x  1 root  admin    35B 29 Jun 13:59 libsvnjavahl-1.dylib@ -> /usr/local/lib/libsvnjavahl-1.dylib
lrwxr-xr-x  1 root  admin    36B 29 Jun 13:59 libsvnjavahl-1.jnilib@ -> /usr/local/lib/libsvnjavahl-1.jnilib

Using new installed subversion

homebrew installs items into /usr/local/Cellar/<software>/<version>/ and symlinks the most recent item to /usr/local/bin and /usr/local/lib. Finally add the new path /usr/local/bin to PATH by adding the following line into your ~/.profile file:

$ vi ~/.profile
export PATH=/usr/local/bin:$PATH

Open a new tab in Terminal by typing -T and type svn --help, this should show up the correct version.

$ svn --help
usage: svn  [options] [args]
Subversion command-line client, version 1.8.0.
Type 'svn help ' for help on a specific subcommand.
Type 'svn --version' to see the program version and RA modules
  or 'svn --version --quiet' to see just the version number.

Most subcommands take file and/or directory arguments, recursing
on the directories.  If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
   blame (praise, annotate, ann)
   changelist (cl)
   checkout (co)
   commit (ci)
   copy (cp)
   delete (del, remove, rm)
   diff (di)
   help (?, h)
   list (ls)
   move (mv, rename, ren)
   propdel (pdel, pd)
   propedit (pedit, pe)
   propget (pget, pg)
   proplist (plist, pl)
   propset (pset, ps)
   status (stat, st)
   switch (sw)
   update (up)

Subversion is a tool for version control.
For additional information, see
JavaHL in eclipse

Restart eclipse and check Settings > Team > SVN > SVN Interface - it should automatically find the new bindings, see attached screenshot of settings dialog.


Don’t forget to install Subclipse Version 1.10 to use Subversion 1.8. In eclipse you can achieve that by changing the update site of your Subclipse Software Site to:

Updated on Feb 02, 2014

I’ve stopped using svn and switched to git.


comments powered by Disqus