May 27 2009

If you created a project in Eclipse, but you created a regular “Project” instead of a particular project type (in my case, a “PHP Project” then there is a fairly easy way of fixing it. I had to do this to make a particular project work in the PHP Explorer (which for some reason worked fine on Windows version of Eclipse, but not my version…)

Create a new project of the type you want to convert your existing project to. In my case, I just created a new PHP Project. Alternatively, you can use an existing PHP Project (or project of the type you want to convert to) if you have one. Open the .project file of this, and copy the <natures> and <buildSpec> XML sections. Open the .project file of the project you wish to convert. Remove the old <natures> and <buildSpec> sections and replace with the copied section. If you have other <natures>, for example PDE etc., then you’ll have to merge them by hand. Mine now looks a little like this:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>someprojectname</name>
	<comment></comment>
	<projects>
		<project>otherproject</project>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.dltk.core.scriptbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.php.core.ValidationManagerWrapper</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.php.core.PHPNature</nature>
	</natures>
</projectDescription>

It’s as simple as that! Close the project and re-open it and you’ll have all the magical features of PDT (or whichever project type you wanted…)

May 9 2009

Just a quick reminder to myself as I always end up Googling for this. The update sites for CollabNet for Eclipse are:

Current Release (1.5.1):

Eclipse 3.2: http://downloads.open.collab.net/eclipse/update-site/e3.2

Current Release (1.8.1):

Eclipse 3.3: http://downloads.open.collab.net/eclipse/update-site/e3.3
Eclipse 3.4: http://downloads.open.collab.net/eclipse/update-site/e3.4

Development Builds:

Eclipse 3.2: http://downloads.open.collab.net/eclipse/dev-builds/e3.2
Eclipse 3.3: http://downloads.open.collab.net/eclipse/dev-builds/e3.3
Eclipse 3.4: http://downloads.open.collab.net/eclipse/dev-builds/e3.4

These are sourced from: http://desktop-eclipse.open.collab.net/servlets/ProjectProcess?pageID=3794

May 7 2009

Whenever I tried to get CollabNet for Eclipse plugin working in Eclipse PDT, it always failed, yielding the error “Unable to load SVN client” upon any SVN activity. I did endless amounts of Googling to try to solve the problem, but always came to a brick wall.

The big problem here is that Eclipse is just too new for Ubuntu – even Jaunty. An apt-get install subversion on Jaunty Jackalope will install subversion 1.5.4, which just doesn’t work, and thats where the big problem lies. CollabNet for Eclipse categorically requires Subversion 1.6. Unfortunately the only solution I’ve come up with is to compile subversion and it’s javahl bindings yourself. I’ll try and remember all the steps I took to make it work.

First, download the latest subversion and subversion-deps tgz from http://subversion.tigris.org/. At time of writing they are here and here. Extract them both:

$ tar zxvf subversion-1.6.1.tar.gz
$ tar zxvf subversion-deps-1.6.1.tar.gz
$ cd subversion-1.6.1

You’ll need to install a couple of extra packages (this assumes you’re using Sun’s JRE), and assuming you already had subversion and libsvn-javahl already installed, uninstall a couple:

$ sudo apt-get install libssl-dev sun-java6-jdk g++
$ sudo apt-get remove subversion libsvn-javahl

Configure, make and install subversion. You can check it’s the right version too:

$ ./configure --disable-nls --enable-javahl --with-jdk=/usr/lib/jvm/java-6-sun-1.6.0.13
$ make
$ sudo make install
$ svn --version

Once that’s done, you’ll want to compile the javahl binding. Once installed, check it’s installed correctly too. It’s fairly likely the .so file will be in /usr/local/lib.

$ make javahl
$ sudo make install-javahl
$ sudo updatedb
$ locate libsvnjavahl-1.so
$ sudo ldconfig

Open your eclipse.ini, and after the -vmargs line, add:

-Djava.library.path=/usr/local/lib

replacing the path with the path where the libsvnjavahl-1.so with your correct path.

Now fire up Eclipse, go to Window > Preferences > Team > SVN. The SVN Interface should now say JavaHL (JNI) 1.6.1 and a revision, depending on the particular version of SVN you installed.

I think that’s all the steps I took, so I apologise if I missed something out – if I remember something I’ll add it in!

Update: Compiling javahl requires g++, so I added that into the apt-get install line.

Update 2: Missed out ldconfig after libraries creation.

Update 3: If you still have issues getting it to work, I recommend looking at http://subclipse.tigris.org/wiki/JavaHL, reading it carefully, especially the Troubleshooting on Linux section. The javahltests.jar JUnit tests that are provided on the page may be very handy when debugging problems!

Feb 21 2009

zendserverconfigOK, so far all that I’ve managed to do is install it and have a dabble with the config pages and go “oooh that looks pretty”, so this isn’t a hardcore review or anything.

Zend have unveiled their newest product, Zend Server… which is essentially Zend’s own W/M/LAMP stack, but with Zend Framework and other components Zend have written, including the very handy Zend Debugger. What does that mean? Well to me, that means there’s quite an easy choice for my web development at home – I just installed it in 10 minutes and now have a fully working WAMP stack I can develop on before pushing to my Linode test server. It was 100 times easier than any other WAMP stack I’ve worked with including XAMPP and the other ones I’ve tried. It has a very shiny web GUI as well (pictured), that – as I mentioned before – I went “oooh” at lots. I personally think Zend Server has the potential to be really frickin’ awesome if I get to know it better. From the Public Beta Invitation e-mail, Zend states it includes:

  • Fully supported and certified distribution of PHP 5.2
  • Fully supported Zend Framework 1.7 release
  • Integrated native installers (RPM/DEB/MSI)
  • Web-based administration Interface
  • Comprehensive out-of-the-box database connectivity
  • Powerful PHP monitoring capabilities to identify problems and help fix them quickly
  • URL-based output caching required by today’s modern web applications
  • Zend Optimizer+ – byte code cache to boost application performance
  • New “Guard Loader” to enable processing of Zend Guard encoded files

Not bad – and there’s a community edition too, which means if you’re a sole developer like me it’s affordable.

<rant>Unfortunately, they don’t do a community edition of Zend Studio for Eclipse… and although PDT is good, I feel like its the hacky “well Zend Studio uses PDT at it’s core” alternative – without the cool enhancements that ZS has… oh well!</rant>

Jan 16 2009

As we’re off skiing tomorrow (wahey!), I was setting up Hannah’s laptop with Eclipse PDT, and after installing Subclipse, I decided to have a go at setting up Mylyn to use my Trac install with the Mylyn Trac connector. It all went well until I tried adding the Trac repository, where it decided that it was invalid. A quick Google revealed the general concensus that Trac 0.11 (the most recent Trac version) doesn’t work with the Mylyn plug-in.

Thankfully, it turns out that this isn’t the case. It was a simple case of running:

easy_install http://trac-hacks.org/svn/xmlrpcplugin/trunk/

Then restarting apache:

/etc/init.d/apache2 restart

Now go into your Trac admin page, and enable XMLRPCSystem, XMLRPCWeb and all plug-ins with “.ticket” in the module name.

Now in Mylyn when adding your Task repository, specify the XML-RPC (rev 1950) access type along with the rest of your settings, and it’s as easy peasy as that.

There – I told you I’d blog something soon!