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
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)