What to do when an Eclipse plug-in doesn’t work
Yesterday I spent an hour trying to help dj
Padák get a plug-in working in Eclipse. We didn’t manage it in the
end, unfortunately, but I’d like to share a few general tips that have always
worked for me. I’d welcome your observations too.
What to know before installing
Versions, or birds of a feather
The basic rule is to install only plug-ins made for the version of Eclipse
you use. Eclipse follows x.y.z versioning. The x is the major
version. Major versions differ in the Eclipse API, which the
plug-ins depend heavily on. The y is the minor version. I’m not quite
sure, but the API may change there too, probably only in
backward-compatible ways, such as adding to the API. An increase in z
means
maintenance changes such as bug fixes.
The current release is 3.1 M4, where M means milestone. As a rule,
the API keeps changing throughout
the milestones. Eclipse 3.0 had nine
milestones during development, and the API only started to look frozen around M7. A
later milestone didn’t necessarily mean a better one. Either
M8 or M9 was noticeably slower. If you run a milestone build
of Eclipse, nobody can guarantee that a plug-in will work.
Where to install a plug-in
There are two ways to install a plug-in. The first is
Install/Update (Help >> Software Updates >> Find and Install), but that works
only for some kinds of plug-in. If it’s an option, the
plug-in site will have instructions. Use it and you’ll at least
save time looking for dependencies or other components the plug-in
needs.
The other way assumes you’ve downloaded the plug-in or got it from somewhere
else. Some plug-ins come in a directory structure you can simply
copy into ECLIPSE_HOME, the eclipse directory. You’ll recognize the structure
by a
plugins directory or by both plugins and features. If the package contains only
the plug-in directory itself, copy it to ECLIPSE_HOME\plugins. After installing a
plug-in,
it’s a good idea to restart the IDE.
Where the plug-in shows up
Often a user doesn’t know or hasn’t read which part of
Eclipse the plug-in integrates with. It may appear as a view, perspective
or wizard. If it has settings, look under Window >>
Preferences. A tip for diehards who still can’t find where the blasted
plug-in ended up. Examine its plugin.xml to see the extension points
it’s attached to. I’m not entirely serious about that last tip.
How to tell whether the plug-in is failing
After installing a plug-in and restarting the IDE, everything may look right but the plug-in
won’t work. First check whether it installed
without errors. There are several ways to check.
- Help >> About >> Plugin Details (the plug-in should be listed)
- Help >> Software Updates >> Manage Configuration (the plug-in should
be listed) - Window >> Show view >> other >> PDE >> Plug-ins (the plug-in should
be listed)
If the plug-in is absent, reports an error or behaves incorrectly,
check the Error log. Eclipse has an Error log view you can open
through Window >> Show view >> Other >> PDE Runtime. If Eclipse won’t
start at all, you’ll have to read the log from the file
ECLIPSE_HOME\workspace\.metadata\.log. If the messages don’t help,
it’s time to call a friend, Google.
Plug-in dependencies are a major trap. I’ve had modeling
tools that depended on GEF. Without the right version of GEF,
the plug-in didn’t work. The log and Google can help you find out. If the plug-in
should work with your version of Eclipse and still doesn’t, try installing
it in a clean environment. Install a fresh copy of Eclipse and
add only the plug-in you want and any dependencies.
Related articles
Related CZ Podcast episodes
- #3 · Java 6 SE, Vývoj webových aplikací
Dagi and Filemon discuss Java 6 and web application frameworks. · Czech audio
- #1 · Vývojová prostředí v Javě
The first CZ Podcast episode looks at Java development environments. · Czech audio