Cet article est également disponible en Français.

Using Subversion with Eclipse on OS X

I recently had to install Subclipse for one of my course projects, and I've had some trouble making it work. That's why I decided to make a quick tutorial to help people do this. If you happen to come across other problems, don't hesitate to tell me in the comments. We'll look for a solution together, which will help me improve this tutorial.

The first thing you'll need to do is install another version of Subversion, since the one that comes with OS X doesn't provide the JavaHL library we need. To do this, you have to install Homebrew, so open a Terminal (Applications > Utilities > Terminal) and type the following command:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Enter your root password when asked. Now, you can install Subversion (replace subversion by subversion17 for Subversion 1.7.x or by subversion16 for Subversion 1.6.x):

brew install --java subversion

If everything goes well, you'll see that Homebrew requests that you execute two commands, which should be the following two (if they're different, enter the ones displayed in your Terminal, obviously):

sudo mkdir -p /Library/Java/Extensions
sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Now, to use Subversion with Eclipse, you need to install Subclipse. To do that:

  1. Open Eclipse
  2. In the menu, go to Help > Install New Software...
  3. In the Work with field, enter one of the following URLs:
    • http://subclipse.tigris.org/update_1.10.x if you installed Subversion 1.8.x
    • http://subclipse.tigris.org/update_1.8.x if you installed Subversion 1.7.x
    • http://subclipse.tigris.org/update_1.6.x if you installed Subversion 1.6.x
  4. Check Subclipse and SVNKit and click on Next
  5. Leave everything checked and click Next
  6. Accept the license agreements and click on Finish
  7. Wait until the download and the installation finishes
  8. Restart Eclipse when asked

Once all this is done, you can start using SVN with Eclipse. Here's how:

  1. Window > Open Perspective > Other > SVN Repository Exploring
  2. Do a right-click in the left part of the window, then go to New > Repository Location
  3. In the Url field, enter the URL of your repository
  4. Enter your credentials if asked
  5. Do a right-click on the repository that appeared and click Checkout
  6. In the window that opens, leave everything by default and verify the option Check out as a project configured using the New Project Wizard is checked
  7. Click Finish and answer Yes to the prompt that appears
  8. Choose Java Project and click Next
  9. Finally, give your project a name and click Finish

I hope this tutorial helped you. As I said before, don't hesitate to report problems or ask questions in the comments. Happy coding :-)

Thank you for taking the time to read this post. If you liked it, perhaps share it with people you know?

You may also support the writing of these posts using the Flattr button below or by offering me a beer.

You may also subscribe or follow me on social media using the buttons below.

Comments

comments powered by Disqus
Subscribe

If you want to receive an email every time I publish something new, leave your email below. I will never disclose it to third parties.