Saturday, August 23, 2008

Update svn on Leopard to play nice with subclipse

Not so long ago I moved forward to STS 1.1 which is based on Eclipse 3.4 Ganymede. Of course I needed a svn plugin and then I ran into this issue.

Mac OSx packages an old version of collabnet subversion (1.4.x). And that doesn't play nice with subclipse. The fix suggested there is to use an old version because:

For Windows users, it is a simple matter of installing the new Subversion 1.5 client and making sure JavaHL is on the path. For Unix users, this workaround obviously defeats the purpose of having a distro with package management and requires manual installation of the libraries in the correct locations.

If you truly understand that and it is a blocking concern for you (notice the hint of sarcasm), don't read on. There is however a very simple solution to run the right version and just make it work.

  1. Download and install http://www.collab.net/downloads/apple/download.html
  2. sudo rm /usr/bin/svn* (you might want to check if you haven't got any other programs named svn* before you do this)
The second step is needed because the collabnet package installs simlinks into /usr/local/bin and the programs in /user/bin take precedence.

Once this is done you're good to go, and with the latest versions.

Update: I've moved on to do this with MacPorts, lately their svn versions are fine, and the installation is much simpler.

2 comments:

Unknown said...

Wouldn't it be safer just to add:

export PATH='/usr/local/bin/':$PATH

to your bash profile so /usr/local/bin/ takes precedence over /usr/bin/?

Simo Salminen said...

Now the install produce is changed a bit. After installing, add this to your ~/.profile:
export PATH=/opt/subversion/bin:$PATH

This is documented on the installer screen.