Search code examples
osgiosgi-bundlebndtools

Bndtools and org.osgi.util.tracker package


I'm using Bndtools in Eclipse IDE. It's great and works fine. I'm able to add osgi.core package into the "Build Path" editing the bnd file (it uses the bndtools repositories). Now I need the org.osgi.util.tracker package but I can't find it in the "Build Path" editing the bnd file. How can I do it ?

Thanks, Paolo


Solution

  • org.osgi.util.tracker is a package but in the Java compiler we need to put whole JARs on the build classpath.

    This package happens to come from the bundle/JAR called osgi.cmpn, which represents the OSGi Compendium specifications. So just add osgi.cmpn to the -buildpath of your bnd.bnd file and the package you want will be visible.

    If you don't know what JAR/bundle a package comes from, you can use the Advanced Search button in the Repositories View in Bndtools. If you can't find it there then you will have to go and get the JAR from the outside world and import it into your repository. Just googling for the package name will usually tell you the name of the library you need.