B4J Question Error starting standalone package

fabton1963

Member
Licensed User
Longtime User
if I start my appication.jar using folowing commandline
B4X:
c:\java\jdk-11.0.1\bin\java.exe --module-path c:\java\jdk-11.0.1\javafx\lib --add-modules=javafx.controls,javafx.fxml,javafx.web -jar myapp.jar

runs without any errors, but if I build a Package the application does not start and I get the following error

B4X:
main._btnopen_action (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.SerialPort.<init>(Unknown Source)
        at b4j/anywheresoftware.b4j.serial.Serial.Open(Unknown Source)
        at b4j/b4j.example.main._btnopen_action(Unknown Source)
        at b4j/b4j.example.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/b4j.example.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.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)


I'm using b4j 9.80
Java:
java 11.0.12 2021-07-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)

any idea to fix it?
 

agraham

Expert
Licensed User
Longtime User
Forum search is your friend. Possibly this thread, post #102.
 
Upvote 0

jahswant

Well-Known Member
Licensed User
Longtime User
I also found this problem when I updated to the latest version of B4J. Seems like the Command to copy the jssc.dll is not executed. I had to copy manually to the bin folder after creating the package.
 
Upvote 0

jahswant

Well-Known Member
Licensed User
Longtime User
B4X:
#CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, ..\ temp\build\bin\ jssc.dll
Please can someone verify on their side if this command works well.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
@jahswant I have found sometimes

B4X:
#CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, ..\ temp\build\bin\ jssc.dll

did not copy jssc.dll and so had to copy it manually.

I raised this issue in this post where I suspect it is due to the delay on my machine of completing the copying of that file to temp\build\bin\ before the InstallerScript.iss script is run.
 
Upvote 0
Top