I have the following error:
$ sudo java -jar /home/fadedbee/tc65sh-1.4.0/bin/tc65sh.jar -Djava.library.path=/usr/lib/jni/ -cp /usr/share/java/RXTXcomm.jar -p /dev/ttyUSB0 -b 115200 -f push.txt
tc65sh v1.4.0
processing command file push.txt
connecting /dev/ttyUSB0 with 115200 baud, flowControl r
Exception in thread "main" java.lang.NoClassDefFoundError: gnu/io/CommPortIdentifier
at org.tc65sh.device.Device.connect(Device.java:56)
at org.tc65sh.Main.exec(Main.java:102)
at org.tc65sh.Main.main(Main.java:59)
Caused by: java.lang.ClassNotFoundException: gnu.io.CommPortIdentifier
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 3 more
I've installed libRXTX and all the files appear in the correct places:
$ ls -lA /usr/lib/jni/
total 148
-rw-r--r-- 1 root root 22696 May 9 2018 librxtxI2C-2.2pre1.so
lrwxrwxrwx 1 root root 21 May 9 2018 librxtxI2C.so -> librxtxI2C-2.2pre1.so
-rw-r--r-- 1 root root 14424 May 9 2018 librxtxParallel-2.2pre1.so
lrwxrwxrwx 1 root root 26 May 9 2018 librxtxParallel.so -> librxtxParallel-2.2pre1.so
-rw-r--r-- 1 root root 22688 May 9 2018 librxtxRaw-2.2pre1.so
lrwxrwxrwx 1 root root 21 May 9 2018 librxtxRaw.so -> librxtxRaw-2.2pre1.so
-rw-r--r-- 1 root root 22704 May 9 2018 librxtxRS485-2.2pre1.so
lrwxrwxrwx 1 root root 23 May 9 2018 librxtxRS485.so -> librxtxRS485-2.2pre1.so
-rw-r--r-- 1 root root 59824 May 9 2018 librxtxSerial-2.2pre1.so
lrwxrwxrwx 1 root root 24 May 9 2018 librxtxSerial.so -> librxtxSerial-2.2pre1.so
$ ls -lA /usr/share/java/ | grep RXTX
-rw-r--r-- 1 root root 63027 May 9 2018 RXTXcomm-2.2pre2.jar
lrwxrwxrwx 1 root root 20 May 9 2018 RXTXcomm.jar -> RXTXcomm-2.2pre2.jar
I can see the correct class inside of the jar file:
$ strings /usr/share/java/RXTXcomm.jar | grep CommPortIdentifier
gnu/io/CommPortIdentifier.class
gnu/io/CommPortIdentifier.classPK
How can I help Java find the class?
(I've already tried changing the option order to sudo java -Djava.library.path=/usr/lib/jni/ -cp /usr/share/java/RXTXcomm.jar -jar /home/fadedbee/tc65sh-1.4.0/bin/tc65sh.jar -p /dev/ttyUSB0 -b 115200 -f push.txt
but the error remains.)