Unfolding automatically an Eclipse plugin jar

后端 未结 3 397
囚心锁ツ
囚心锁ツ 2021-01-24 18:55

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

相关标签:
3条回答
  • 2021-01-24 18:57

    If you package your plugin(s) as a feature then you can specify this behavior in Feature manifest editor.

    0 讨论(0)
  • 2021-01-24 19:05

    You can check the unpack option while you are creating Feature project for your plugin project.

    0 讨论(0)
  • 2021-01-24 19:18

    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)

    0 讨论(0)
提交回复
热议问题