Thursday 23 February 2012

Eclipse with Android and Subversion

In preparation for the coding, I spent some time updating eclipse for Android and Subversion.

To get the Android eclipse development environment to work, I ended up re-installing eclipse from scratch - it told me it had conflicting requirements between ADT and java-EE, and refused to budge. I had to install the 'proper' sun jvm too, no luck with the openjdk version. After that, installing adt as described in google's page worked fine. I still had an old SDK installation, it was happy to update that to the current state (btw: there are no 'close' buttons on the eclipse android configuration pages: use 'escape' to close).

Subversion was a bit more tricky. Debian installs svnserve with the basic svn package, but no startup scripts. This page describes how to set up the '/etc/init.d/svnserve' script that starts up svn - just change the path to the location of the repository. The repository needs to be created with 'svnadmin create path/to/rep' (it creates a few files and directories at that location), and I needed to set up permissions. See Tony's helpful page for how to.

I didn't import an existing directory (as Tony does), instead I installed RapidSVN - an SVN Gui - and used that to create a new directory within the repository (modify -> make directory). This directory will be the root for all parts of this project - android and arduino based. The URN for the svnserve server, if installed on your local machine with default settings, should be svn://localhost:3690 (svnserve doesn't support http based browsing).

The subclipse plugin caused another eclipse problem. On a windows machine recently it was straighforward.  On linux you have to install JavaHL individually - and while it's available as libsvn-java, neither debian nor ubuntu currently have version 1.7 of this library which is required for the 1.8 subclipse plugin. However, as this post notes, debian and other packages for javaHL 1.7 can be found at this repository. I just added
deb http://opensource.wandisco.com/debian squeeze svn17
into my /etc/apt/sources.list, added the signature to my key ring, and updated libsvn-java.

I am a bit jealous of the tortoiseSVN windows client, which is very nice, mainly for browsing and organizing the repository. I am now trying RabbitVCS, maybe that's similar (Debian is 2 versions behind though, as it is not using Nautilus 3 yet).

Update while debian's libsvn-java puts the javaHL libraries into /usr/lib/i386-linux-gnu/jni, the version from wandisco is stored at /usr/lib/jni. The correct path needs to be added to the eclipse.ini file (' -Djava.library.path=/usr/lib/jni')

No comments:

Post a Comment