我创建了一个包含以下文件夹结构的插件:
- 源代码
- 本机/so/libsystemcommand.so
- 元信息/清单.MF
清单包括命令
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Commands Plug-in
Bundle-SymbolicName: de.system.commands;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: de.system.commands.CommandsPlugin
Bundle-Localization: plugin
Bundle-NativeCode: native/so/libsystemcommand.so; osname = Linux; processor = x86
Require-Bundle: org.eclipse.core.runtime,
org.apache.commons.logging
Eclipse-AutoStart: true
Export-Package: de.system.commands,
de.system.commands.jni,
de.system.commands.utils
Bundle-ClassPath: .
build.properties 看起来像
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
native/
在我Activator
上课的开始方法中,我打电话
System.loadLibrary("systemcommand");
在运行时找不到库并抛出UnsatisfiedLinkError 。
java.lang.UnsatisfiedLinkError: no libsystemcommand in java.library.path
我必须在插件中设置更多属性吗?我是否必须在目标平台上解压缩一些信息?
编辑:
java.library.path=/opt/jdk/j2re1.4.2_16/lib/i386/client:/opt/jdk/j2re1.4.2_16/lib/i386:/opt/jdk/j2re1.4.2_16/../lib/i386::/opt/dsa/lib:/opt/dsa/lib