Difference between revisions of "FAQ What causes my plug-in to build but not to load in a runtime workbench?"

From Eclipsepedia

Jump to: navigation, search
 
Line 37: Line 37:
  
 
[[FAQ_When_does_PDE_change_a_plug-in%26%23146%3Bs_Java_build_path%3F]]
 
[[FAQ_When_does_PDE_change_a_plug-in%26%23146%3Bs_Java_build_path%3F]]
 +
 +
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>

Revision as of 16:12, 14 March 2006

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 project’s 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 project’s 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.



See Also:

FAQ_How_do_I_add_an_extra_library_to_my_project’s_classpath?


FAQ_My_runtime_workbench_runs,_but_my_plug-in_does_not_show._Why?


FAQ_When_does_PDE_change_a_plug-in’s_Java_build_path?


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.