0

I have made a Java serial Interface using RxTx libraries in Netbeans 7.2.1 which works fine.

enter image description here

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- enter image description here

and then clean and build to get jar at location

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

with below structure enter image description here

with lib having RxTx.jar

Now when I try to run from command prompt: I get below error

enter image description here

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.

Community
  • 1
  • 1
Gaurav K
  • 2,864
  • 9
  • 39
  • 68

1 Answers1

0

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
dratewka
  • 2,104
  • 14
  • 15
  • Is the error the same? Have your tried using an absolute path (`-Djava.library.path=C:/SOME_PATH/lib`)? Also try copying the dll's to the directory where te jar file is located and see if it changes anything. – dratewka Oct 02 '13 at 09:57