Category Archives: Eclipse

Eclipse Subversive SVN+SSH and Putty Agent (pageant)

I’m using Subversive within Eclipse to provide SVN support. But since I’m now using SVN+SSH as connection mechanism to SVN, I wanted to use my SSH Key to do the authentication for me. It took me some time to find out (find with google ;) how I could get this to work. I ended up on another blog which contained a working explanation on how to get it to work.

You need to create an environment variable called “SVN_SSH” that points to an executable file that accepts the same command line arguments as ssh on unix. I did this by doing the following:-

  1. Set up ssh keys. Not going to cover that here as you can easily Google for that. You need to end up with your public key on the SVN server and your private key loaded into Paegent locally.
  2. Download and installed the excellent TortoiseSVN client for Windows.
  3. Set the following environment variable (by right-clicking on My Computer, Properties, Advanced, Environment Variables, New):-

    Variable name:
    SVN_SSH
    Variable value:
    C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe

    (The “\\” is very important, otherwise it won’t work. Equally, you cannot use the plink.exe that comes with putty as that fires up a command shell window which is really annoying. The TortoisePlink.exe is a windows implementation of plink that doesn’t bring up any UI)
  4. Configure the Subclipse plugin to use JavaHL (JNI)
  5. Restart Eclipse
  6. Do a little victory jig (optional)

Yes the \\ is really needed, don’t (yet) understand why, but it works.

If you dislike Tortoise, then you can set the SVN_SSH variable to c:\\putty\\plink.exe -ssh -2 -A -l username

But as Martin said, plink has one disadvantage. It creates a msdos popup window each time it’s used…

JavaHL is also needed, SVNKit doesn’t use the SVN_SSH variable.

Talking about Tortoise… A while ago I encountered some annoying lock problems (maven clean install didn’t work because maven was not allowed to delete the target directory). This was caused by the Tortoise cache. Now I disabled it in total, which helped against my locking issue, and the performance of my explorer increased as well. So it’s a win/win situation. And since I like to develop using Ubuntu, I’m not used to see the svn status in my explorer window right away anyways (although I’ve to say, it can be useful, if it didn’t cause problems I would have kept it).

Perhaps this locking problem is related to having my workspace on an ext2 fs partition on my usb drive… Not sure who to blame, yet. On my new workstation I’ve not had such locking problems yet, with this tip the cache is performing good enough.

Keyboard shortcuts

Perhaps you have noted that I added a new site to the list of sites I like: Windows Keyboard Shortcut of the Day. Using keyboard shortcuts just improves your work speed a lot.

A few windows shortcuts that I didn’t know before

Windows + BREAK
Go to system properties
CTRL + SHIFT + ESC
Taskmanager
Windows + R
Run command

Eclipse

I also found a nice blog entry about eclipse shortcuts. But he lacks to explain one of the uses for CTRL + T: if you have a certain function you can find which class implements that function with CTRL + T as well. Very useful when you are working a lot with interfaces.

This is also a good site with Eclipse shortcuts. Not sure if it’s a bad thing that it’s not updated to Eclipse 3.4, yet. One helpful command is missing on that list: CTRL + SHIFT + L. This lists all bound keyboard shortcuts and pressing it again gives you the opportunity to change and export them to .csv (at least the export function is there on Eclipse 3.4).

Mac OS X

And a while ago I found a nice site with lots of Mac OS X keyboard shortcuts. The shortcut to make your mac sleep quickly was provided by me :-) There is also a shortcut to restart your mac quickly without confirm, Cmd + Ctrl + Eject. Quite annoying if you use that one when you want to put your mac to sleep.

Creating your own debian package for non-source applications

For magproductions I needed a debian package of our “own version” of Eclipse (latest Eclipse with certain plugins pre-installed).

At first I was told to look at checkinstall, but since I didn’t have a makefile, that was not the answer. In the end I used the debian-administration guide to create my own package.

I changed the install into a few mkdir -p and cp -r commando’s and the clean into a rm -r command. That’s basically it. I didn’t think it would be that simple.

svn move multiple directories with confirm

I had to rearrange multiple directories, but not all, in a svn tree to make a project more compatible with Eclipse. For this I used the following one-liner so I could do this more easily.

for file in `find -maxdepth 1 -type d`; do \
echo -n $file "[y/n] "; \
read -n 1 shouldMove ; \
if [ "$shouldMove" == "y" ]; \
then \
svn mv `basename $file` WebContent/`basename $file`; \
fi; \
done

This way I was sure all directories I wanted to move were moved (since a svn mv does not remove the directory right away, it does that on commit).