# sudo apt-get install librxtx-java <dependency> <groupId>org.rxtx</groupId> <artifactId>rxtx</artifactId> <version>2.2pre2</version> <scope>system</scope> <systemPath>/usr/share/java/RXTXcomm-2.2pre2.jar</systemPath> </dependency> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12.3</version> <configuration> <argLine>-Djava.library.path=/usr/lib/jni</argLine> </configuration> </plugin> Ensure that you have correct version of rxtx lib install on your operating system under the path /usr/share/java/RXTXcomm-2.2pre2.jar you have all rxtx system libs under the /usr/lib/jni. You can check location of librxtx-java using following command dpkg -L librxtx-java In order to add loopback on ports /dev/ttyS90 and /dev/ttyS91 run sudo socat PTY,link=/dev/ttyS90 PTY,link=/dev/ttyS91 from command line (used in loopback test with specified ports)