Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse library bundle - fails to export packages from some libraries

Tags:

java

eclipse

osgi

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...

like image 847
Andreas Dolk Avatar asked Dec 23 '22 07:12

Andreas Dolk


1 Answers

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.

like image 161
Francis Upton IV Avatar answered Mar 30 '23 00:03

Francis Upton IV