Jump to: navigation, search

Difference between revisions of "FAQ Why doesn't my plug-in build correctly?"

m
m
 
Line 1: Line 1:
It is important to realize that a plug-in consists of a manifest description  
+
It is important to realize that a plug-in consists of a manifest description written in XML and an independent implementation written in Java. The <tt>plugin.xml</tt> file defines the prerequisite plug-ins and effectively defines the classpath for your own plug-in classes. A typical build problem is caused by a change to the build classpath, often indirectly owing to a change to the <tt>plugin.xml</tt> file. This may happen when you extract a plug-in out of CVS, for instance. The classpath settings are copied from the CVS repository but were put there by someone who may have had a different installation location for Eclipse. Be careful, as the classpath consists mainly of hard-coded file system locations.  
written in XML and an independent
+
implementation written in Java. The <tt>plugin.xml</tt> file defines
+
the prerequisite plug-ins and effectively defines the  
+
classpath for your own plug-in classes. A typical build
+
problem is caused by a change to the build classpath,
+
often indirectly owing to a change to the <tt>plugin.xml</tt> file.
+
This may happen when you extract a plug-in out of CVS,  
+
for instance. The classpath settings are copied from the
+
CVS repository but were put there by someone who may
+
have had a different installation location for Eclipse.
+
Be careful, as the classpath consists mainly  
+
of hard-coded file system locations.  
+
  
To recompute the classpath, use the context menu
+
To recompute the classpath, use the context menu on your project: '''PDE Tools &gt; Update Classpath'''. This will instruct PDE to look at your <tt>plugin.xml</tt> file and construct a build classpath specific to your Eclipse installation and workspace contents.
on your project: '''PDE Tools &gt; Update Classpath'''.
+
This will instruct PDE to look at your <tt>plugin.xml</tt> file and  
+
construct a build classpath specific to your Eclipse installation
+
and workspace contents.
+
  
If your plug-in relies on other broken plug-ins in your workspace,
+
If your plug-in relies on other broken plug-ins in your workspace, your plug-in may not be able to build itself. Start with the offending plug-in and work your way up the dependency hierarchy to find the problem. When all else fails, try '''Project &gt;Clean...''' to force everything to be rebuilt from scratch.
your plug-in may not be able to build itself.
+
Start with the offending plug-in and work your way up the
+
dependency hierarchy to find the problem. When all else fails,  
+
try '''Project &gt;Clean...''' to force everything to be rebuilt
+
from scratch.
+
  
 
== See Also: ==
 
== See Also: ==
*[[FAQ_How_do_I_set_up_a_Java_project_to_share_in_a_repository%3F]]
+
*[[FAQ How do I set up a Java project to share in a repository?]]
*[[FAQ_What_is_the_classpath_of_a_plug-in%3F]]
+
*[[FAQ What is the classpath of a plug-in?]]
 +
 
 +
{{Template:FAQ_Tagline}}

Latest revision as of 04:55, 17 June 2006

It is important to realize that a plug-in consists of a manifest description written in XML and an independent implementation written in Java. The plugin.xml file defines the prerequisite plug-ins and effectively defines the classpath for your own plug-in classes. A typical build problem is caused by a change to the build classpath, often indirectly owing to a change to the plugin.xml file. This may happen when you extract a plug-in out of CVS, for instance. The classpath settings are copied from the CVS repository but were put there by someone who may have had a different installation location for Eclipse. Be careful, as the classpath consists mainly of hard-coded file system locations.

To recompute the classpath, use the context menu on your project: PDE Tools > Update Classpath. This will instruct PDE to look at your plugin.xml file and construct a build classpath specific to your Eclipse installation and workspace contents.

If your plug-in relies on other broken plug-ins in your workspace, your plug-in may not be able to build itself. Start with the offending plug-in and work your way up the dependency hierarchy to find the problem. When all else fails, try Project >Clean... to force everything to be rebuilt from scratch.

See Also:


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.