FAQ What causes my plug-in to build but not to load in a runtime workbench?
Here is a typical scenario for a new user: You are writing a plug-in that extends plug-in XYZ. To get it to compile, you add a reference to the JAR file for plug-in XYZ to your projects build path either from the Java Build Path property page or by editing the .classpath file. When you launch a runtime workbench, the following surprising error is reported: java.lang.NoClassDefFoundError: XYZ.SomeClass. Do not start looking in the Plug-ins and Fragments tab in the launch configuration for the runtime workbench. That tab influences only which plug-ins are used for your runtime workbench and whether they are loaded from the workspace or from the Eclipse install directory.
Instead, start looking in the plug-in manifest. Edit the plugin.xml file and ensure that XYZ is mentioned as a required plug-in. Then, save the plugin.xml file. This will update the projects build path automatically.
Never manually edit the .classpath file when you are writing a plug-in. The plug-in Manifest Editor simply overwrites any changes you make to it. Not very civilized, but that is the way it works.
This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.