我是 Java 和 Eclipse 的新手。我的项目使用依赖于本机 dll 的 3rd 方 jar。我将这些 dll 放在 bin 文件夹下,这在 eclipse 中运行良好。
我使用“Fat Jar Exporter” eclipse 插件 将我的项目导出为可执行 jar。使用 JDK jar 实用程序,我注意到 jar 正在 fat jar 之外的目标中寻找 javafx dll,即使这个 dll 存在于 jar 的根目录中。
如何修改 jar 清单,以便它从 jar 中选择这些 dll,或者我应该在将 jar 从 eclipse 中导出时设置一些路径。
我尝试添加glass.dll;processor=x86;osname=win32,在 Bundle-NativeCode 但它不起作用。
这是清单文件的外观,
Manifest-Version: 1.0
Created-By: Fat Jar Eclipse Plug-In
Main-Class: com.bosch.mvci.ui.UI
Name: com/sun/jna/
Implementation-Title: com.sun.jna
Implementation-Vendor: JNA Development Team
Implementation-Version: 3.4.1 (b671)
Specification-Title: Java Native Access (JNA)
Specification-Vendor: JNA Development Team
Specification-Version: 3
Bundle-ManifestVersion: 2
Bundle-Name: jna
Bundle-Description: JNA Library
Bundle-SymbolicName: com.sun.jna
Bundle-Version: 3
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-Vendor: JNA Development Team
Bundle-ActivationPolicy: lazy
Export-Package: com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32,javafx
Bundle-NativeCode: com/sun/jna/win32-x86/jnidispatch.dll; processor=x8
6;osname=win32, com/sun/jna/win32-amd64/jnidispatch.dll; processor=x8
6-64;osname=win32, com/sun/jna/w32ce-arm/jnidispatch.dll; processor=a
rm;osname=wince, com/sun/jna/sunos-x86/libjnidispatch.so; processor=
x86;osname=sunos, com/sun/jna/sunos-amd64/libjnidispatch.so; processo
r=x86-64;osname=sunos, com/sun/jna/sunos-sparc/libjnidispatch.so; pro
cessor=sparc;osname=sunos, com/sun/jna/sunos-sparcv9/libjnidispatch.s
o; processor=sparcv9;osname=sunos, com/sun/jna/aix-ppc/libjnidispatc
h.a; processor=ppc;osname=aix, com/sun/jna/aix-ppc64/libjnidispatch.a
; processor=ppc64;osname=aix, com/sun/jna/linux-ppc/libjnidispatch.s
o; processor=ppc;osname=linux, com/sun/jna/linux-ppc64/libjnidispatch
.so; processor=ppc64;osname=linux, com/sun/jna/linux-i386/libjnidispa
tch.so; processor=x86;osname=linux, com/sun/jna/linux-amd64/libjnidis
patch.so; processor=x86-64;osname=linux, com/sun/jna/linux-arm/libjni
dispatch.so; processor=arm;osname=linux, com/sun/jna/linux-ia64/libjn
idispatch.so; processor=ia64;osname=linux, com/sun/jna/openbsd-i386/
libjnidispatch.so; processor=x86;osname=openbsd, com/sun/jna/freebsd-
i386/libjnidispatch.so; processor=x86;osname=freebsd, com/sun/jna/fre
ebsd-amd64/libjnidispatch.so; processor=x86-64;osname=freebsd, com/s
un/jna/darwin/libjnidispatch.jnilib; osname=macos,glass.dll; processo
r=x86;osname=win32,javafx-font.dll; processor=x86;osname=win32,