Tomcat : Using RXTX with Tomcat applications on linux

This page last changed on May 30, 2013 by admin.

Install the proper linux package

apt-get install librxtx-java

Put the library on Tomcat's classpath

Add -Djava.library.path=/usr/lib/rxtx:/usr/lib/jni to JAVA_OPTS

Houston we have a problem?

On booting the app RXTX reports the following:

Native lib Version = RXTX-2.2pre2
Java lib Version   = RXTX-2.1-7
WARNING:  RXTX Version mismatch
    Jar version = RXTX-2.1-7
    native lib Version = RXTX-2.2pre2

The Fix

The download site states:

TODO: The 2.2pre2 bins contain the 2.2pre1 jar file and the 2.2pre2 native lib which causes a mismatch warning

So not a problem after all? At least they are at the same minor version now.

Next issue: no ports found


Adding as a startup parameter as suggested by this article did not make a difference.

The article also mentions:

To run the Java application later without root, we need a new user which has the privilege to access serial ports. To do so, just add a new user to group dialout

So in my case:

sudo adduser tomcat dialout