title: How do I tell an Eclipse plugin where a native library resides for an external plugin?
body: <p>I have an Eclipse plugin that is a Java wrapper for a C++ library. I'm running on Linux so the wrapper provides a .jar and a .so. I've created a plugin project from this latter existing JAR archive. I have pointed to the .so in the native library location for the jar.</p>
  
  <p>I have another plugin that references this wrapper plugin. I can successfully run a standalone java application from this other plugin that utilizes the wrapper plugin successfully. The class that uses it has to import the java class from the wrapper jar and, before instantiating anything from the wrapper library, I have to call System.loadLibrary. This means I've set the native library location correctly, et cetera.</p>
  
  <p>When I try to do the same kind of operation but within an OSGi context using a product definition, I get a java.lang.UnsatisfiedLinkError. If I edit the run configuration for the product definition to add <code>-Djava.library.path=&lt;full path to the .so&gt;</code>, I am again able to run -- i.e., the library functions properly.</p>
  
  <p>How do I add this path to the plugin configuration? Do I have to create a ClassLoader from my BundleContext inside of my Activator class or is there a plugin configuration way to do this?</p>
  
  <p>I thought I had the right thing by add the path to the .so to the Runtime Classpath in the MANIFEST.MF of my wrapper plugin but that doesn't appear to do it -- I guess it is just for the classpath -- not the library path. Imagine that. </p>
  
  <p>Any ideas?</p>