B4J Question Could not load jssc library - Linux, B4JPackager11 - SOLVED

Gandalf

Member
Licensed User
Longtime User
Hi,

I try to package serial terminal application on Linux (Mint20). Other apps are packing Ok there, so setup is correct in general. I have extracted libjSSC-2.8_x86_64.so from jssc.jar and placed into /bin after packing, tried different versions of it, last one from this post. Tried renaming the library file any ways I could imagine. This solution did not work also. Nothing helps, I still get the following error:

main._refreshportlistbtn_click (java line: -1)
java.lang.UnsatisfiedLinkError: Could not load the jssc library: Couldn't load library library jssc
at b4j/jssc.SerialNativeInterface.<clinit>(Unknown Source)
at b4j/jssc.SerialPortList.<clinit>(Unknown Source)
at b4j/anywheresoftware.b4j.serial.Serial.ListPorts(Unknown Source)
at b4j/gic.espwifiterm.main._refreshportlistbtn_click(Unknown Source)
at b4j/gic.espwifiterm.main._appstart(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
at b4j/gic.espwifiterm.main.start(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

Any advise, please?
 

Gandalf

Member
Licensed User
Longtime User
Thank you for prompt reply!

With command
./jdk-11.0.1/bin/java --module-path ./jdk-11.0.1/javafx/lib --add-modules=javafx.controls,javafx.fxml,javafx.web -jar terminal.jar
it runs Ok.

Tried the latest version of the library, extracted libjssc.so from jssc.jar\natives\linux_64, no success, "Could not load...".

CPU type on host machine is Intel Core i5-7300U. Linux Mint 20 x64 runs under VirtualBox with 2 CPU cores allocated.
 
Upvote 0

Gandalf

Member
Licensed User
Longtime User
Problem solved. File libjssc.so should be placed not to /bin folder, but to /lib folder instead. I didn't succeed with copying it automatically through #CustomBuildAction: After Packager instruction, manual copy worked just fine.
 
Upvote 0
Top