简体   繁体   English

使用外部库准备独立Java应用程序时出错

[英]Error in preparing standalone Java application with external libraries

I have made a Java serial Interface using RxTx libraries in Netbeans 7.2.1 which works fine. 我已经使用Netbeans 7.2.1中的RxTx库制作了一个Java串行接口,它可以正常工作。

在此处输入图片说明

Tested it with NULL modem and it works fine. 使用NULL调制解调器对其进行了测试,并且工作正常。 Now I need to create an exe which I can distribute. 现在,我需要创建一个可以分发的exe。

So,Now I am trying to make a jar file for my project. 所以,现在我正在尝试为我的项目制作一个jar文件。 What I did- 我做了什么- 在此处输入图片说明

and then clean and build to get jar at location 然后清洁并建造,以便将罐子放置在适当的位置

"D:\\Glaswegian\\Java\\Slides\\RxTx\\SerialCommInterface\\SerialCommInterface\\dist" “ D:\\ Glaswegian \\ Java \\ Slides \\ RxTx \\ SerialCommInterface \\ SerialCommInterface \\ dist”

with below structure 具有以下结构 在此处输入图片说明

with lib having RxTx.jar 与具有RxTx.jar的lib

Now when I try to run from command prompt: I get below error 现在,当我尝试从命令提示符运行时:我得到以下错误

在此处输入图片说明

Can anyone please let me know how to resolve this? 谁能让我知道如何解决这个问题?

Have refered Run jar file in command prompt How can I include external jar on my Netbeans project 在命令提示符下引用了运行jar文件。 如何在Netbeans项目中包含外部jar

But not able to resolve it. 但无法解决。

The system cannot find some native libraries (which probably are needed by RxTx). 系统找不到某些本机库(RxTx可能需要)。

Assuming that the native libraries ( *.dll ) are in the lib folder - try to run the app like this: 假设本地库( *.dll )位于lib文件夹中-尝试像这样运行应用程序:

java -Djava.library.path=lib -jar SerialCommunicator.jar

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

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