Skip to content

Node Using System RXTX

Matt Magoffin edited this page Oct 29, 2018 · 6 revisions

Using the system-provided RXTX package in SolarNode

Many OS distributions provide the RXTX as an easily-installed package. For example Debian has the librxtx-java package; FreeBSD has the comms/rxtx port. This page describes how to configure the SolarNode framework to use the system-provided RXTX using the default Equinox-based launch configuration.

All systems

For all systems, first modify the Equinox configuration file conf/config.ini and add the following line:

org.osgi.framework.system.packages.extra=gnu.io

Then complete the remaining steps specific to your node's OS, listed below.

Debian

After installing the librxtx-java package, create a symlink to /usr/share/java/RXTXcomm.jar in the JRE's lib/ext directory. For example using the OpenJDK 7 JVM:

ln -s /usr/share/java/RXTXcomm.jar \
/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/RXTXcomm.jar

or for OpenJDK 8 on i386:

ln -s /usr/share/java/RXTXcomm.jar \
/usr/lib/jvm/java-8-openjdk-i386/jre/lib/ext/RXTXcomm.jar

or for OpenJDK 8 on armhf (Orange Pi, etc):

ln -s /usr/share/java/RXTXcomm.jar \
/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/ext/RXTXcomm.jar

or for Oracle JDK on a Rasberry Pi:

ln -s /usr/share/java/RXTXcomm.jar \
/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/ext/RXTXcomm.jar

Then you must add the following to your solarnode startup script's JVM_ARGS:

-Djava.library.path=/usr/lib/jni

FreeBSD

Installing the comms/rxtx port, which automatically puts the JAR and shared library into the JRE directly. Note that the port might default to installing in the Java 6 JRE. To use a Java 7 JRE, for example, add JAVA_VERSION=1.7+ to the make command.

Clone this wiki locally