Eclipse, Subversion and Subclipse installation/integration on Windows

I have been using CVS as the source management tool for my pet projects for a long time. Recently I moved to Subversion and this article provides a step by step how to guide on configuring Subversion server and integrating Subversion client in Eclipse IDE. I use Windows XP on the developer machines and the Subversion server and hence this is a Windows only article. Following are the application versions I use for this article,

Installing Eclipse ganymede (3.4.1)

For Java, Ruby and PHP development I use Eclipse platform. What makes Eclipse so powerful is the availability of a large number of free plugins. The latest Eclipse release is code named ganymede (version 3.4.x) and is much more stable than the earlier versions. For PHP development, I use the PDT extension to Eclipse. Similar toolkits are available for other languages such as Ruby and Java. I usually download the Eclipse IDE for Java EE developers and then add additional plugins as needed.

Installing Eclipse is very easy. Just download the zip file and extract the contents to a folder. The package contains eclipse.exe binary to start the IDE.

I use the built in update manager of Eclipse to keep the installation up to date. Update manager can also be used to install third party plugins. Later I will show you how you can use the same to install the Subversion plugin called Subclipse.

Installing Subversion Server (1.5.4) on Windows XP

Subversion is an open source free software project by Collabnet. Unfortunately to download Subversion, you need to register at the Collabnet Web site. Only after registering and verifying your email you will be able to download Subversion binaries. After logging in choose the Windows binary as shown in the following picture.

Downloading Subversion for Windows

This is a 10MB Windows executable(CollabNetSubversion-server-1.5.4-1.win32.exe). During the installation please select a location to install the binaries and also a location to use as the repository for all your projects. See the following screen shots for the options I have selected.

Installing Subversion on Windows - Step 1Installing Subversion on Windows - Step 2

I have selected both SVNSERVE and Apache to enable multiple client protocols. For local network access I use SVNSERVE and for WEBDAV access I use the Apache server.  The default port for SVNSERVE is 3690 and you can install the server as a service so that subversion is automatically started when Windows is booted.

Installing Subversion on Windows - Step 3Installing Subversion on Windows - Step 4
On the Apache configuration page the default port is 80 and I have changed it to 81 to avoid potential conflicts. For example, if you are using Skype it usually listens on port 80. Note that my repository location is "C:/svn_repository" and I have installed Subversion under "C:/Program Files" folder.  Please change this as per your needs.

Installer configures Apache server and SVNSERVE server as Windows services. But they are not started by default. You need to either restart the machine or start the services manually from the control panel.

When I tried to start the Apache service I got an error,

Windows could not start the Apache2.2 on Local Computer. For more information, review the System Event Log.

On inspecting the application event log (control panel -> administrative tools -> event viewer) I found the following error text,

The Apache service named  reported the following error:
>>> httpd.exe: Syntax error on line 116 of C:/Program Files/CollabNet Subversion Server/httpd/conf/httpd.conf: Cannot load C:/Program Files/CollabNet Subversion Server/httpd/modules/mod_dav_svn.so into server: The specified module could not be found.

The error message is misleading and the exact cause is the missing dependent dll files for mod_dav_svn.so. The quickest solution to this problem is to copy all the dll files under Subversion installation folder (C:\Program Files\CollabNet Subversion Server) to the bin and modules directory of apache(C:\Program Files\CollabNet Subversion Server\httpd\bin and C:\Program Files\CollabNet Subversion Server\httpd\modules folders in my case).

To test the Apache installation, point your browser to http://localhost:81 and you should see the message "It works!".

Configuring Subversion on Windows

Let us look at the minimum configuration required to get the Subversion up and running. The repository location is specified during the the installation. If the repository is properly setup you will a "conf" folder inside it.  If the conf folder is missing you can create the repository folder using the following command,

svnadmin create "c:\svn_repository"

Open the svnserve.conf file in this folder and modify it to contain the following lines,

anon-access = none

auth-access = write

password-db = passwd

This ensures that a valid userid/password is required to commit to the Subversion repository. After this open the passwd file in the same folder and add a user. Following is a sample user,

jayson = jaypassword

jayson is the Subversion user id and jaypassword is the password for the user. Now we are all set to integrate Subversion with Eclipse using Subclipse plugin.

Note: Refer this page for more details on the path based authorization supported by Subversion. I don’t need it for the small projects I work on.

Installing Subclipse plugin on Eclipse

Subclipse is a free tool which integrates Subversion client to the Eclipse installation. This way you can do all the Subversion operations from the Eclipse IDE without the need for a command line or graphical client tool.

Configuring Subclipse on Eclipse - Step 1 You can install Subclipse in two ways – you can either download the plugin and manually add it to Eclipse or use the Eclipse auto update to install the plugin directly. I prefer the second method.

From the Eclipse menu select Help -> Software Updates -> Available Software. Click on "Add Site" button on the right. Enter the URL http://subclipse.tigris.org/update_1.4.x and click "Ok".

Expand the Subclipse site added on the left. You will see a number of packages under it. Select all of them (some of them are shown as optional but if you don’t add them you will get another strange error (Unable to load default SVN client) when you try to run the Subversion plugin. The installation will take a while to complete (It took about 20 minutes on my system and I have a 2mbps link!). Restart Eclipse after installation.

Adding a new project to Subversion using Subclipse

Configuring Subclipse on Eclipse - Step 2Configuring Subclipse on Eclipse - Step 3

Open the SVN Repository Exploring view and then click on "Add SVN Repository".  Then you need to give the URL of the machine where SVN server is installed. In my case the SVN server machine had the local LAN IP as 192.168.0.3 and hence the URL for repository is svn://192.168.0.3.  If you have the Eclipse and SVN on same machine you can use 127.0.0.1.

Configuring Subclipse on Eclipse - Step 4Configuring Subclipse on Eclipse - Step 5

After adding the repository, switch to Dynamic Web project view. Right click on the project you want to add to the Subversion configuration management and click on "Team -> Share Project". In the next page select repository type as "SVN".

Configuring Subclipse on Eclipse - Step 6Configuring Subclipse on Eclipse - Step 7

Select the repository location which had earlier added and then select the project name same as the name of the folder you are adding.

Configuring Subclipse on Eclipse - Step 8

Finally type in the userid/password you have configured in the "passwd" file under the conf folder of Subversion repository. Use the "save password" option so that Eclipse remembers your userid/password. Now the "Team" context menu for the Eclipse project will have the complete set of Subversion options including checkin/checkout and history view.

Click here to get latest site updates delivered to your email. You need to confirm subscription by clicking on the link sent by feedburner to your email address.


December 19, 2008 | Posted in Programming 3 Comments » | By Jayson Joseph

3 Comments to “Eclipse, Subversion and Subclipse installation/integration on Windows”

  1. shuron Says:

    Thank you for posting and i don’t want to start a religios war windows vs linux.
    But see how it’s done in linux.

  2. denis Says:

    This is really helpful information especially solving the apache error. Installation and configuration steps provided were crisp and clear. Great Job buddy

  3. Importing existing source code into Eclipse | Thusitha Mabotuwana's Blog Says:

    […] Here is a pretty good guide that gives all the glory details related to setting subclipse up. […]

Leave a Comment