Pages: [1]   Go Down
Author Topic: Interfacing with Java - Jar problems  (Read 724 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

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:
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
java.library.path
        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.
« Last Edit: August 09, 2012, 09:27:20 pm by Terraviper-5 » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: