Interfacing with Java - Jar problems


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:

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while
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 SerialDriver.initialize(

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.