Eclipse: An Empty ‘Available Software’ List

The Problem

I recently (reluctantly) installed Eclipse on my Linux development box (Ubuntu 9.10) for the first time in over a year. I quickly ran into problems when trying to view and install available plug-ins on the ‘Available Software’ list (available from the menu: Help > Install New Software…). The available software list appears to be empty, however, it seems that it is actually not being painted correctly.

A quick search pulled up a bug report that suggests a problem with Eclipse’s use of the GTK, and a little more searching found an explanation about mixing calls through the GTK with calls to the native windowing system.

The Solution

The solution is to make sure all Eclipse GUI calls go directly to the native windowing system, avoiding the mix of native and GTK calls. This involves setting the GDK_NATIVE_WINDOWS shell environment variable. If starting eclipse from the command line, then this can be done as follows:

$ export GDK_NATIVE_WINDOWS=1
$ eclipse

If starting from a desktop short-cut or similar, then rename the eclipse executable to, say, `eclipse.bin` and create the following shell script, named eclipse, in the same directory:

#!/bin/bash

export GDK_NATIVE_WINDOWS=1
$(dirname $0)/eclipse.bin

Be sure to allow users with the requisite permissions to execute this script – from the command line:

$ chmod ug+x eclipse

Ownership of the new script file may also need changing:

$ sudo chown $(ls -l eclipse.bin | awk '{OFS=":"; print $3,$4}') eclipse

(That’s the long way round, but it saves a little explaining and introduces an interesting use of awk!)

Eclipse Again – An Aside

I switched to Netbeans a while ago, having grown weary of the bugs I was encountering in Eclipse – I find Netbeans to be extremely stable and trouble-free, by-the-way.

I installed Eclipse again recently in order to take advantage of the Android Development Tools (ADT) plug-in for Eclipse and soon faced having to deal with the bug described above. I’d like to get on with the job of developing decent software and an IDE that requires trouble-shooting, work-arounds and restarts takes me away from that and breaks concentration. That’s frustrating!

I’m inclined to attribute this bug to quality issues in the Eclipse code-base. That’s based upon using Eclipse for a number of years (primarily for Java and C++ development) and seeing it become increasingly unstable. The explanation regarding mixing GUI calls may also add weight to this view – Eclipse would seem to breaking Demeter’s Law in an interesting way by going extra lengths to by-pass the GDK layer from within the JRE.

My recent experience with Eclipse has done nothing to bring me back to using it again, and so I’ll continue to use the ever improving Netbeans where possible.

Tags: ,