3

In the manifest file for an eclipse plugin its possible to add jar files and folders to the classpath (on the Runtime tab).

In the root of my plugin I have a folder lib containing a-1.0.1.jar, b-1.0.0-SNAPSHOT.jar. But only when I select each jar separately:

Bundle-ClassPath: .,
 lib/a-1.0.1.jar,
 lib/b-1.0.0-SNAPSHOT.jar

...can they be used inside my project. Why is it not possible to add them to the classpath by adding the common root folder only:

Bundle-ClassPath: .,
 lib/

?

Lii
  • 11,553
  • 8
  • 64
  • 88
u123
  • 15,603
  • 58
  • 186
  • 303

1 Answers1

0

No, you can't. Eclipse is based on OSGi, which is the platform providing MANIFEST.MF support to build plugins.

When you set values under Bundle-ClassPath, OSGi search into each one to find class files. So you can put folders containing Java packages and class files. When you put a jar file, it is uncompressed in memory and viewed by OSGi as a regular folder, still searching for class files.

Unfortunately, there is no way to load all jar from a folder. No wildcard mechanism or something like that is allowed here.

Lii
  • 11,553
  • 8
  • 64
  • 88
Antwane
  • 20,760
  • 7
  • 51
  • 84