Jobs Fast Jobs Fast

Installing Eclipse/Subclipse on Windows 7 x64

Subclipse is a great subversion plugin for Eclipse allowing very tight integration into the IDE. Installing it on a 64-bit JVM is a bit tricky, however, and not as straightforward as it probably should be. Today’s post will walk through setting up Subclipse on a fresh Eclipse install.

We’ll be doing this the “right way”, using public key authentication (“passwordless”), but I’ll also point out the steps that can be skipped if you want to enter a password each time with an asterisk*. Note: entering a password for every transaction gets very tedious and I would recommend using public key authentication as I outline.

First, I’ll list the versions I’m working with:

  • Java: 1.7.0_03(x64)
  • Eclipse: 3.7.2 (Indigo) (x64)
  • SilkSVN: 1.7.5.1 (x64)
  • Subclipse: 1.8

You’re free to use a newer version if this post becomes outdated, but things may change which may or may not invalidate this walkthrough.

Prerequisites

A 64-bit JVM installed. Installing subclipse is presumably a lot easier if you have a 32-bit JVM installed.

Install

Update: I originally outlined the steps necessary to install a version of Subclipse that included packages that were shortly thereafter outdated. Mark Phippard, the project manager for Subclipse and developer for Subversion stopped by and updated us with the current status of the project, including fact that the updated packages make this install a lot easier. As a result, I’ve struck out the steps (4,5) that were made unnecessary in the latest update. Thanks Mark!
  1. Install Eclipse (Indigo x64)
  2. Install Subclipse via Eclipse (Help – Intstall New Software – Add)
  3. Exit Eclipse
  4. Download and Install SlikSVN — This is needed for the 64-bit JavaHL libraries. (What is JavaHL and why do I need it?) Make sure you select the 64-bit edition.
  5. Ensure you have MSVC++ 2010 (x64) Redistributable Package Installed. If you think you have this installed, you can skip this step. If you encounter an Eclipse error dialog stating: no msvcp100 in java.library.path, you’re missing this.
  6. Install TortoiseSVN (or just download TortoisePlink.exe). Note that TortoisePlink.exe is different than the PLINK.EXE that is provided by the PuTTY package and using that version will not work.
  7. Download Puttygen.exe* (available here, either as part of the entire PuTTY package or alone). Note that this step will be necessary if (a) you want to use passwordless login and (b) you don’t already have a private/public keypair (if you’re unsure about this, you probably don’t have one and generating another one is no big deal).
  8. Create Public / Private Keypair using Puttygen.exe* — save these somewhere you’ll remember (I use %HOMEPATH%\Keys which is (on Win7) C:\Users\<username>\
  9. Install public key on remote computer.* Note: this might depend on the OS of your subversion server, but generally the steps are the same: (1) copy public key to subversion server, (2) add key to ~/.ssh/authorized_keys. Something like:
    cat id_rsa.pub >> ~/.ssh/authorized_keys
  10. Configure Subclipse to use plink. Open %appdata%\Subversion\config and in the [tunnels] section, add the line
    ssh = C:/Progra~2/Putty/TortoisePlink.exe -l username -i C:/path/to/private_key

    Notes: (1) change paths and username as appropriate, (2) The path separator should either be a single forward slash or a double (escaped) backslash. If you decide not to use public key authentication, drop the last (i) option.

  11. Launch Eclipse
  12. Open SVN Configuration (Window – Preferences – Team – SVN) and ensure JavaHL (JNI) 1.7.5 … is selected under (SVN Interface – Client) and an error dialog isn’t displayed. If you get an error dialog and the dropdown contains JavaHL (JNI) Not available, you may have forgot to exit and restart Eclipse or something went wrong while installing SlikSVN.
  13. Add repository (Window – Open Perspective – Other… – SVN Repository Explorer – Right click in “SVN Repositories” – New – Repository Location) and enter repo location (svn+ssh://subversion.server/path/to/repo)

Results

At this point, one of four things should happen:

  • Your repository opens up in the Repo Browser. Congrats! You set up Subclipse successfully. Code on!
  • A password dialog opens up. Typically this is because either (a) you erred when specifying your private key on the ssh=… line, or (b) you didn’t, or didn’t correctly, add the public key to the authorized_keys file.
  • You get a red console error:
    Network connection closed unexpectedly
    svn: Unable to connect to a repository at URL ‘svn+ssh://path/to/repo’
    svn: To better debug SSH connection problems, remove the -q option from ‘ssh’ in the [tunnels] section of your Subversion configuration file.

    This means that you were able to connect to the server, but for some reason the connection later failed. This could be because you specified an incorrect username. Ensure your TortoisePlink.exe options are correct.
  • You get a red console error:
    The system cannot find the file specified.
    svn: Unable to connect to a repository at URL ‘svn+ssh://path/to/repo/’
    svn: Can’t create tunnel: The system cannot find the file specified.

    This means that Subclipse couldn’t locate TortoisePlink.exe. Ensure your path is correct and your path separators are appropriate.
Posted Thursday, June 7th, 2012 under linux, networking, tips and tricks.

2 comments

  1. A couple points:

    1) You do not need to do steps 4 and 5. Subclipse 1.8.x includes everything you need. Note that I just fixed a bug in JavaHL 1.7.5.1. The Eclipse p2 metadata did not include the instruction to tell Eclipse to unpack the JAR that contains the Windows 64-bit DLL’s. There is a new 1.7.5.2 version posted where this has been fixed. I guess that must be the version you installed because no other versions had that problem and this one was only posted for 24 hours. Bad timing.

    2) Using TortoisePlink should work once you install the newer JavaHL. Note that SVNKit is also a good option if you are using SSH. It includes a Java SSH client so the experience within Eclipse is much nicer. Normally I recommend using JavaHL, but SSH might be the one scenario where it is better to use SVNKit.

    Mark

  2. Hi Mark,

    I just checked and I did write this using (and have installed) 1.7.5.1. Bad timing indeed. I’ll update my walkthrough accordingly. Thanks for the post and thanks for your work on such great projects.

Leave a Reply