Build path considerations

By default, the dependencies page will dynamically manage the build path of your plug-in project. If you turn this feature off and if you add or remove a plug-in in your dependency list, you are responsible for updating the build path so that the required entries are added. If you do not, the Java compiler will not be able to resolve references to types that belong to the required plug-ins.

If you turn the automatic feature off, there are two ways for PDE to assist you in calculating your build path. You can explicitly request selecting Compute Build Path in the popup menu on the Dependencies Page. You can also use the "Plug-in Development->Java Build Path Control" preferences page. If you check the "When modifying dependencies in plug-in manifest editor" button, your build path will be automatically updated each time you change dependency information and save the editor.

PDE will recreate the build path from scratch in both of these cases. That means that you will lose any entries you have added manually to the build path.  The build path is updated from scratch because PDE builds it recursively.  Here's why:

If a Java class is referenced by a plug-in at run time, its libraries will be searched first for the class, then the libraries of its required plug-ins, then the libraries of their required plug-ins, and so on. In order to recreate a similar lookup environment during design time, PDE updates the build path recursively. It's possible for several different plug-ins to depend on the same library. If you delete one of these plug-ins from your dependency list, it is not safe to remove libraries all the way up the chain because some of the plug-ins you still have on the list may be needing them. The only way to always maintain a valid build path is to create it from scratch.

It is not necessary to have the manifest editor open to update the build path of a plug-in. You can also select the plug-in manifest file in the Navigator or Package Explorer view, bring up the pop-up menu and select "Update classpath...". A wizard will open:

"Update class path" wizard

The checkbox list will contain all the plug-ins and fragments in the workspace. Initially, only the selected plug-in will be checked, but you can change it. Pressing 'Finish' will re-compute class path for each selected plug-in project.

In order to provide for better sharing of projects on authoring servers, PDE adds all external libraries to the build path relative to the run-time platform location represented by the Java build path variable ECLIPSE_HOME. This way, you can have your code on the server and it will work regardless of the location of your platform install. This variable is set and managed by PDE and you are not supposed to modify its value.

Copyright IBM Corporation and
others 2000, 2002