Go Down

Topic: Interfacing with Java - Jar problems (Read 756 times) previous topic - next topic


Aug 10, 2012, 04:22 am Last Edit: Aug 10, 2012, 04:27 am by Terraviper-5 Reason: 1

I have been trying to send signals to my Arduino Uno via serial port using Java and rxtxSerial.dll library. After a few problems, I have managed to do so and it worked flawlessly (if I count out 30 second long scan of ports because I couldnt find fixed 64-bit version of the library). From NetBeans. As soon as I try to run my program from jar, I (again) get this error:

Code: [Select]

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while
loading gnu.io.RXTXCommDriver
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: no rxtxSerial in
       at java.lang.ClassLoader.loadLibrary(Unknown Source)
       at java.lang.Runtime.loadLibrary0(Unknown Source)
       at java.lang.System.loadLibrary(Unknown Source)
       at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
       at SerialDriver.initialize(SerialDriver.java:27)
       at Clock.run(Clock.java:11)

I have been getting this error before I found out that I have to put rxtxserial.dll into c:/program files/java/jdk1.7.0_03/jre/bin and rxtxcomm.jar into c:/program files/java/jdk1.7.0_03/jre/lib/ext. After that, it worked. But as soon as I wanted to run my app standalone, I get this error. Can anybody help me please? Thanks!

PS: NetBeans has included the RXTXcomm.jar in accompanying lib folder.


Ok, found out what the problem was. NetBeans uses different Java Runtime Environment for app development than these apps use later when they are run standalone. This JRE is built in JDK. Therefore these two files are required in the exact same place in the standalone JRE too, not only in JDK's JRE.

Go Up

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

shortcuts: alt+s submit/post or alt+p preview