arduino serial monitor fails: ... java.lang.NoClassDefFoundError: jssc.SerialPortEventListener

Hi all
I use OS 15.3, updated as of latest with zypper ref && zypper up.
Arduino 1.8.19-lp153.2.1 is installed from obs://build.opensuse.org/CrossToolchain:avr
jssc 2.8.0-lp153.8.1 also from obs://build.opensuse.org/CrossToolchain:avr

I write, compile/verify and upload skteches to an arduino uno R3 w/o problems. Now I’d like to attach an lcd to the uno. Verified, I got the correct libraries and also the peoper wireing for good. No mistake there. Need to get the adress of the LCD, I follow https://funduino.de/nr-06-zwei-i²c-displays-gleichzeitig , copied the code indicated and pasted it into a new sketch. Compile/verify and upload: no problem. But as soon as I try to open the serial monitor, I get:


Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: jssc.SerialPortEventListener
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:397)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:358)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:682)
    at java.net.URLClassLoader.access$400(URLClassLoader.java:89)
    at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1086)
    at java.security.AccessController.doPrivileged(AccessController.java:774)....

I found this where they say, that

So perhaps there is a problem with your .jssc directory, or perhaps
there is an incorrect or old version in there (that is missing some
symbols?).

They also say:

If ~/.jssc does not exist then arduino creates and populates it.

Which is not true on my box.

cd ~ 
ls .jss*
access no possible, file or directory not found.

How can I get the arduino serial monitor working?

Help greatly appreciated

greez
chris

First thing is to check if/how the serial is connected.

If I issue “dmesg --follow” and I connect my Adafruit Feather Mo via USB, it lists:

 3260.978549] usb 2-3: new full-speed USB device number 11 using xhci_hcd 
 3261.137323] usb 2-3: New USB device found, idVendor=239a, idProduct=800b, bcdDevice= 1.00 
 3261.137342] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 
 3261.137349] usb 2-3: Product: Feather M0 
 3261.137355] usb 2-3: Manufacturer: Adafruit 
 3261.159356] cdc_acm 2-3:1.0: ttyACM0: USB ACM device 
 3261.159395] usbcore: registered new interface driver cdc_acm 
 3261.159398] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

I guess your arduino uno R3 should show something like this when you connect it via USB. Can you share that output?

Hi marel

Here you go:

dmesg --follow
... {connected uno R3, I see this:}
[192983.196771] usb 3-4: new full-speed USB device number 23 using xhci_hcd 
[192983.351175] usb 3-4: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01 
[192983.351178] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=220 
[192983.351180] usb 3-4: Manufacturer: Arduino (www.arduino.cc) 
[192983.351181] usb 3-4: SerialNumber: 7543730383035180F092 
[192983.352997] cdc_acm 3-4:1.0: ttyACM0: USB ACM device

to me, that looks OK.
Greez
chris

Same problem here. This bug has made me definitely move onto the official IDE download (that one works well). Unfortunately, the Arduino support in OpenSUSE is virtually nonexistent: the last time I reported a bug it was just closed because the Arduino IDE v2 was soon to be released and no further resources were to be spent in v1. That was a year ago…

And, the latest build attempt failed – <Welcome - openSUSE Build Service.

  • Which is weird – if the build failed, it shouldn’t have been published …

Looking at the v1.8.19 compressed Tar file from Arduino – <https://www.arduino.cc/en/software&gt; – the last changes were made on the 20th of December 2021.

  • A couple of things to be aware of –

The Arduino installation removes the ModemManager package.
There’s a compiled Java binary provided by Arduino dated the 11th of February 2020 – you’ll need to check if, any conflicts arise with the OpenJDK 11 Runtime Environment installed by default with Leap 15.3.

In the OBS version 1.8.19-lp153.2.1/jssc 2.8.0-lp153.8.1 the symbolic link to the jssc.jar in directory /usr/lib64/arduino/lib is broken


> cd /usr/lib64/arduino/lib/
> ls -l jssc-2.8.0.jar
lrwxrwxrwx 1 root root      34  5. Mär 11:42 jssc-2.8.0.jar -> ../../../share/java/jssc-2.8.0.jar

>ls -l ../../../share/java/jssc-2.8.0.jar 
ls: cannot access '../../../share/java/jssc-2.8.0.jar': No such file or directory


and so the java runtime does not know how to load the jssc-2.8.0.jar. If i fix the symbolic link for example with


> ln -fs /usr/lib64/java/jssc.jar jscc-2.8.0.jar 

serial monitor works for me. A fact that confused me at first the OBS Arduino version installs java 1.8.0 explicit as a dependency. However, the jscc jar was compiled with OpenJdk 11 and therefore does not work with the old Java 1.8.0 runtime.