I know there are two ways of using external libraries in OSGI bundles. As only my package needs the lib (e.g. google-gson) I tried to put it in the Bundle-ClassPath
(manifest.mf). But whenever I run the bundle in Knopflerfish I get the Exception in thread "Thread-74" [stderr] java.lang.NoClassDefFoundError: com/google/gson/Gson
.
As I am new to OSGI I tried to follow the instructions for creating a bundle from here using a build.xml
for compilation where I also included the lib (don't know if this is even correct). So the library appears in three different places, the project classpath, the bundle classpath (manifest.mf) and the build.xml.
I would be glad if someone could give me a hint how to make the library work. Thanks in advance!