Monday, 27 August 2012

Install Subversion and Subclipse for Eclipse on Ubuntu

If you do not have Eclipse installed yet, run:
sudo apt-get install eclipse
Install Subversion
sudo apt-get install subversion
Install the Subversion plugin for Eclipse
Get the Java bindings for Subversion:
sudo apt-get install libsvn-java
Now we are ready to install the plugins in Eclipse.
Open Eclipse.
Go to Help -> Install New Software
Then hit the “Add” button.
Put “Subclipse 1.6.x (Eclipse 3.2+)” under Name and “” under Location:
Add the libraries for Subclipse
Add the libraries for Subclipse

alt text
Setting window/preferences. (pick svkit at bottom): alt text
If you have different Eclipse or Subversion versions, check this list and substitute accordingly:

Name: Subclipse 1.6.x (Eclipse 3.2+)
Name: Subclipse 1.4.x (Eclipse 3.2+)
Name: Subclipse 1.2.x (Eclipse 3.2+)
Name: Subclipse 1.0.x (Eclipse 3.0/3.1)

More info about the different versions:
Then hit “OK”. You will now be presented with these options:
Subclipse Installation Options
Subclipse Installation Options
If you are unsure what Subclipse component you will need, you can check all of them. Also, keep in mind that you can always go back to this in the future and install/uninstall any of the components as needed.
Then “Next” and “Finish” on the subsequent screens.
After the plugins are installed, it will prompt you to restart Eclipse. Go ahead and do so.
You are not done yet. You need to fix the JavaHL.
Edit the eclipse.ini file:
sudo vi /usr/lib/eclipse/eclipse.ini
Add the following line under -vmargs:
Here is what my eclipse.ini file looks like:
$ cat /usr/lib/eclipse/eclipse.ini


Installing Subclipse

The svn/javahl version in Ubuntu 9.04 (jaunty) is 1.5 so you need to install subclipse 1.4, for more info see []. JavaHL is provided by the libsvn-java package, which matches the OS architecture's word size. Note that JavaHL does not install in a location that is on Eclipse's default path, so eclipse must be launched with -vmargs -Djava.library.path=/usr/lib/jni.
To install Subclipse:
You need to install the version of subclipse matching your subversion client, for example with
$ svn --version
svn, version 1.6.17 (r1128011)
the right Remote site for subclipse installation is For details see subclipse documentation
NOTE: On Ubuntu 9.10+ you may need to install the eclipse-pde package before installing Subclipse.
  • Open Eclipse, go into the menus : Help -> Install New Software...
  • Click "Add..." and add a new Remote Site with URL:  Name:
  • Select "Subclipse Plugin" and optionally "Subclipse Book"
  • Next, Next, Accept license terms, Finish.
  • Note: You do not need to select the other "integration" packages unless you have Mylyn or Mylar and plan on integrating with them. In fact, the integration packages can break things unless you have the packages they're intended to integrate with.
  • Restart Eclipse

Configuring a Subversion Repository

To configure Subclipse to connect to a repository open the SVN Repository Exploring perspective:
  • Click on Window -> Open Perspective -> Other
  • Highlight SVN Repository Exploring -> click Ok
You should now have the SVN Repository view open in the right hand column. Now we can add our Subversion repository url:
  • Right click in the SVN Repository column -> New -> Repository Location
  • Enter the url of your repository -> click Ok

Using Subclipse

Once you've configured your repository you can check out code into a new Eclipse project. You can also create new project from Subversion repositories by:
  • Clicking on File -> New -> Project
  • Expand the SVN folder -> Checkout Projects from SVN
You can upload your code into a Subversion repository by:
  • Right click the project -> Team -> Share Project
  • Highlight SVN -> Next
  • Select a Repository you've already configured and click Next, or choose create a new repository location and click Next.
  • Choose the folder you want to upload to and click Finish.
Once you've shared your project or checked one out you can access most common svn functions by right clicking the project and selecting an item from the Team menu.

No comments:

Post a Comment