简体   繁体   中英

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.

在此处输入图片说明

Tested it with NULL modem and it works fine. Now I need to create an exe which I can distribute.

So,Now I am trying to make a jar file for my project. What I did- 在此处输入图片说明

and then clean and build to get jar at location

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

with below structure 在此处输入图片说明

with lib having RxTx.jar

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

But not able to resolve it.

The system cannot find some native libraries (which probably are needed by RxTx).

Assuming that the native libraries ( *.dll ) are in the lib folder - try to run the app like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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