tags:

views:

198

answers:

2

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

+1  A: 

Check the build.properties to see if the bin.includes includes your newly added Jar. Without it, it won't be exported by the build process, and thus won't be able to use it in dependent bundles.

AlBlue
That's not the problem, `bin.includes` includes the lib, even tried sorting and ordering (moved the library to first or last position.. after a while your try even the weirdest things)
Andreas_D
+3  A: 

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.

Francis Upton
Thank you! Thank you! Thank you! #1 was a hit. The lib wasn't checkd in the Order and Export area. Guess it happend because I added that library manually and didn't do a 'add to build path' from the context menu. Problem solved :)
Andreas_D
Yeah, I hit that one sometimes, and usually after some frustration finally check that.
Francis Upton
After spending one hour searching for a solution, #1 was a hit. Funny, I wrote dozen of this kind of plug-ins and did not remember this. Was it always a required manual step?
Barthelemy
@Barthelemy - no, as far as I know it's not a manual step, just sometimes it gets off for some reason, so it's good to check it.
Francis Upton