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 subversion18
by subversion17
for Subversion 1.7.x or by subversion16
for Subversion 1.6.x):
brew install --with-java subversion18
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:
- Open Eclipse
- In the menu, go to Help > Install New Software…
- 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.xhttp://subclipse.tigris.org/update_1.8.x
if you installed Subversion 1.7.xhttp://subclipse.tigris.org/update_1.6.x
if you installed Subversion 1.6.x
- Check Subclipse and SVNKit and click on Next
- Leave everything checked and click Next
- Accept the license agreements and click on Finish
- Wait until the download and the installation finishes
- Restart Eclipse when asked
Once all this is done, you can start using SVN with Eclipse. Here’s how:
- Window > Open Perspective > Other > SVN Repository Exploring
- Do a right-click in the left part of the window, then go to New > Repository Location
- In the Url field, enter the URL of your repository
- Enter your credentials if asked
- Do a right-click on the repository that appeared and click Checkout
- 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
- Click Finish and answer Yes to the prompt that appears
- Choose Java Project and click Next
- 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 :-)