B4J Question [solved] Issue with jSerial v1.40 running on Linux

aminoacid

Active Member
Licensed User
Longtime User
I have a B4J application that has been running fine on Ubuntu under Java 8 (for various reasons I HAVE to use Java 8) using jSerial v1.31

I just updated jSerial to v1.40 and am getting the following error:


Error:
main._openserialport (java line: 924)
java.lang.UnsatisfiedLinkError: Could not load the jssc library: Couldn't load library library jssc
        at jssc.SerialNativeInterface.<clinit>(SerialNativeInterface.java:126)
        at jssc.SerialPortList.<clinit>(SerialPortList.java:49)
        at anywheresoftware.b4j.serial.Serial.ListPorts(Serial.java:80)
        at b4j.example.main._openserialport(main.java:924)
        at b4j.example.main$ResumableSub_WaitForSerialOpen.resume(main.java:2513)
        at b4j.example.main._waitforserialopen(main.java:2486)
        at b4j.example.main._appstart(main.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:117)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:104)
        at b4j.example.main.main(main.java:28)


The same jar works FINE under Windows.

I can always revert back to v1.31 but am just curious as to why this issue happens under Linux and not Windows. I've never had any issues with compatibility between jars run on windows v/s Linux using the jSerial library assuming that the JRE is the same - Java8. So I'm wondering what's different in this latest version of jSerial ??

BTW ... I did also update jCore to v10.31 but I don't think this is the cause of it. I am using B4J v10.30
 
Last edited:
Solution
Ok... after some detective work and testing with different version of jssc starting with version 2.9.4, I found out that it has to do with running on an ARM32 architecture. Starting with jssc version 2.9.5, it looks like ARM32 is either not supported or has a bug that prevents it from loading the library. There is some talk about this as related to the older Raspberry Pi's on their "issues" page. The solution is to use version 2.9.4 or older when running on ARM32 platforms.
So it's not a Java 8 issue, as I tested the latest version of jssc (2.10.2) on Ubuntu Intelx64 and ARM64 with Java 8 and Java 11+ and it ran fine.

This means that if you are using jserial on an older ARM32-based embedded computer (like the older...

aminoacid

Active Member
Licensed User
Longtime User
Ok... after some detective work and testing with different version of jssc starting with version 2.9.4, I found out that it has to do with running on an ARM32 architecture. Starting with jssc version 2.9.5, it looks like ARM32 is either not supported or has a bug that prevents it from loading the library. There is some talk about this as related to the older Raspberry Pi's on their "issues" page. The solution is to use version 2.9.4 or older when running on ARM32 platforms.
So it's not a Java 8 issue, as I tested the latest version of jssc (2.10.2) on Ubuntu Intelx64 and ARM64 with Java 8 and Java 11+ and it ran fine.

This means that if you are using jserial on an older ARM32-based embedded computer (like the older Raspberry Pi models) with Java 8 or any other ARM32 JRE platform, jserial v1.40 will not work. You will have to use jSerial v1.32 or below.
 
Last edited:
Upvote 1
Solution
Top