简体   繁体   English

使用外部库部署jar文件

[英]deploy jar file with external libraries

I am finishing a project that I have to deploy as a jar file, in eclipse it works fine, my project depends on two libraries which also both depends on dll files. 我正在完成一个必须作为jar文件部署的项目,在Eclipse中它可以正常工作,我的项目依赖于两个库,而这两个库也都依赖于dll文件。 I have added the path to these dlls to the native library location of each one of the external jars. 我已将这些dll的路径添加到每个外部jar的本机库位置。 Then I export project as a jar file using the eclipse runnable jar file export wizard I get the jar file in the specified location, it runs but when I click on a button that calls one of the libraries I get I get java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path on the console. 然后我使用eclipse可运行的jar文件导出向导将项目导出为jar文件,我在指定位置获取了jar文件,它运行了,但是当我单击调用其中一个库的按钮时,我得到了java.lang.UnsatisfiedLinkError :控制台上java.library.path中没有rxtxSerial。

Edit : When I copy the dlls in [...]/jre7/bin/ folder my application works, but I want that my application runs without having to do this manipulation. 编辑 :当我将[...] / jre7 / bin /文件夹中的dll复制到我的应用程序时,但我希望我的应用程序运行而不必执行此操作。

Regards. 问候。

像这样运行:java -Djava.library.path = / path_to_dll -jar app.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM