Reputation: 43
I have a project in eclipse that uses rxtx. I have the same project in netbeans, too. They work perfectly, but neither of them works, when I create runnable jars.
I do not know what I do wrong. I tried to change classpaths, adding external libraries...
I must be doing something wrong, but can not not figure out what.
If there is out there somebody who managed to get rxtx work, can you explain step-by-step what to do?
Upvotes: 4
Views: 2366
Reputation: 72399
See my answer here for a fuller explanation, but essentially you must extract the RXTX dll's (or so's, or other native libraries) from the JAR file and place them somewhere on the file system before you attempt to load them (which in this case involves initialising RXTX.) You cannot load the native libraries from inside the JAR file, it won't work.
However, you can have a JAR file that, when it runs, extracts the appropriate native libraries to a temporary location and then loads them from there. The libraries can be set to delete on exit of the VM so they don't end up clogging up the system.
Upvotes: 2