My Eclipse plugin needs to be executed unfolded as a flat directory (it uses JNI, and the JNI part needs access to some files provided by the plugin). Is it possible to configur
If you package your plugin(s) as a feature then you can specify this behavior in Feature manifest editor.
You can check the unpack option while you are creating Feature project for your plugin project.
The most common way to do this is to use org.osgi.framework.Bundle.getEntry(String)
and then org.eclipse.core.runtime.FileLocator.toFileURL(URL)
. getEntry("/jni_lib/")
will return a URL that points to a folder, and FileLocator
will expand the requested bundle URL to the local disk if necessary. This works if you use features or not, if the plugins on disk are exported or not, etc.
@vanaprogeja proposed the second most common option, and needs features to work (which is perfectly acceptable)