Last active
December 22, 2021 14:34
-
-
Save abythell/fff2fdaeb1a4452c0eed to your computer and use it in GitHub Desktop.
Sample script to run Java applications on Raspbian with RXTX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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