javaeclipseosgi

eclipse library bundle - fails to export packages from some libraries


I've created a simple plugin project in eclipse 3.5 that just stores third-party libraries for the use by other bundles in an eclipse RCP application. Worked as expected: I edited the manifest, exported the required packages and added the libraries to the build path (project build path as well as manifest build path).

Some days later I added another jar to that project, did the same steps (exporting a package, adding the library to the build path(s)) but this time I can't import classes from that exported package in other bundles. The package was clearly selectable on the manifest editor but import statements in classes just taunt me with curly red lines. Importing classes from other packages exported by the bundles still works, only classes from the newly added lib remain invisible.

Has anyone has an idea what I might have missed? I'm pretty stuck and have no idea how to convince google to show me the solution to that ugly issue...


Solution

  • Check the following:

    1. Make sure they are in the Build Configuration -> Order and Export area, and they are check for export.
    2. Make sure you have the packages exported in the manifest (PDE Tools -> Open Manifest -> Runtime tab)
    3. In the same place as above, make sure the JAR files are in the manifest classpath.
    4. (as Al says below), make sure the build properties has your jars marked for exclusion (though this is not likely your issue as you are getting errors compiling).

    If all of this is done (and it's still not working), do a clean build an restart eclipse. Sometimes the Eclipse gets a little confused about this and a restart helps.