Skip to content

Instantly share code, notes, and snippets.

@abythell
Last active December 22, 2021 14:34
Show Gist options
  • Save abythell/fff2fdaeb1a4452c0eed to your computer and use it in GitHub Desktop.
Save abythell/fff2fdaeb1a4452c0eed to your computer and use it in GitHub Desktop.
Sample script to run Java applications on Raspbian with RXTX
#!/bin/sh
#
# Configure Java for RXTX on embedded platforms like Raspberry Pi (Raspbian) and Beaglebone (Debian)
#
if [ -e "/dev/ttyAMA0" ] || [ -e "/dev/ttyO0" ]
then
for port in `find /dev -name 'tty*'`
do
PORTS="$PORTS:$port"
done
JAVA_OPT="-Djava.library.path=/usr/lib/jni -Dgnu.io.rxtx.SerialPorts=$PORTS"
fi
java $JAVA_OPT <your-arguments-here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment