B4J Question B4JPackager11 created exe cannot be run

yo3ggx

Active Member
Licensed User
Longtime User
Hi,

I've tried to package my app using B4JPackager11.
This is the log from B4JPackager11.

B4JPackager log:
Waiting for debugger to connect...
Program started.
B4JPackager11 Version 1.15
Exe name: jAReC.exe
InputJar: P:\HAM\jAReC\Objects\jAReC.jar
Running: P:\HAM\jAReC\B4JPackager11\Objects\temp\FindDosPath.exe
Running: C:\java\bin\jar
Package name: ro.yo3ggx.jarec
Running: C:\java\bin\jdeps
.
.
Explicitly excluded modules: [javafx.web]
Included modules: [java.base, java.desktop, java.logging, java.xml, javafx.base, javafx.controls, javafx.fxml, javafx.graphics, javafx.media, javafx.swing, java.scripting, jdk.unsupported, java.datatransfer, jdk.unsupported.desktop, jdk.jsobject, jdk.xml.dom]
Running: C:\java\bin\javac
.
Running: C:\java\bin\jar
Running: C:\java\bin\jlink
.
.
.
.
.
.
.
Running: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe
Running: explorer.exe
.

When running run_debug.bat I get the following error.

Executable error:
P:\HAM\jAReC\B4JPackager11\Objects\temp\build\bin>java.exe @release_java_modules.txt  -m b4j/ro.yo3ggx.jarec.main
jareccore$ResumableSub_InitAppGUI.resume (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/ro.yo3ggx.jarec.jareccore$ResumableSub_InitAppGUI.resume(Unknown Source)
        at b4j/anywheresoftware.b4a.keywords.Common$2$1.run(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)

Where I have to put jssc.jar file? Currently is in the Additional Libraries folder.

Thank you.
Dan
 

bdunkleysmith

Active Member
Licensed User
Longtime User
Experience from a number of users now suggests that the jssc.jar file needs to be replaced by an alternative one when using B4JPackager, at least for 64bit Win 10.

Here is a post where I asked for assistance for the same problem and point to the solution.

Importantly, as we are reminded in that post, "you MUST go into your windows user profile folder and delete the cache .jssc folder", ie. C:\Users\'username'\.jssc\windows\ folder.
 
Upvote 0

yo3ggx

Active Member
Licensed User
Longtime User
Hi.
Is working now. Hope that the app will work as before, as the modified jssc.jar file is more than 2 times smaller than the initial one.

Thank you for the hint.
Dan
 
Last edited:
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
Yes Dan, as I said in my other post, it is counter-intuitive to use a file that is older and smaller, but I know of several others who have found it a successful fix like me.
 
Upvote 0

yo3ggx

Active Member
Licensed User
Longtime User
Unfortunately, after a few days of testing, with the "short" jssc.jar file, I often get blue screen on my Windows 10 computer.
The crash is in the silabser.sys and the error is SYSTEM_THREAD_EXCEPTION_NOT_HANDLED. This does not happen at all with the "big" jssc.jar file.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Did you previously used jSerial v1.31, with the error in the first post?
 
Upvote 0

yo3ggx

Active Member
Licensed User
Longtime User
Yes. 1.31. Same now, but with the modified and shorter jssc.jar and this cause severe stability issues.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
Sorry to read of your new problem Dan. I've not experienced stability or the blue screen problems with my apps incorporating that fix - I hope that doesn't surface over time.

I'm no expert, but wonder if perhaps it's OK with the particular driver for the USB serial device I connect to, but may not be for your particular situation.

I wish you luck in your search for a stable solution. This Forum is a great resource and I'd be confident that someone will assist.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
@Erel at that post should "It is included inside jSerial.jar, under the natives folder." actually say "It is included inside jssc.jar, under the natives folder."?

I want to try this as a "correct" fix for my previous problems, but I'm unsure about where to put jssc.dll and so when you say "This dll should be copied to build\bin folder.", where is that folder?

Also, do you think I will have to follow the instruction "you MUST go into your windows user profile folder and delete the cache .jssc folder", ie. C:\Users\'username'\.jssc\windows\ folder from this post because it says "Java likes to use this instead of whats in the Jar!!!"?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
"It is included inside jSerial.jar, under the natives folder." actually say "It is included inside jssc.jar, under the natives folder."?
Yes, I've fixed it.

"This dll should be copied to build\bin folder.", where is that folder?
This is the folder that is created when you run B4JPackager11. First run the packager and then copy the file.

Also, do you think I will have to follow the instruction "you MUST go into your windows user profile folder and delete the cache .jssc folder", ie. C:\Users\'username'\.jssc\windows\ folder from this post because it says "Java likes to use this instead of whats in the Jar!!!"?
I don't think that it will be needed.
 
Upvote 0
Top