B4J Question [SOLVED] JSerial Windows 10 crash

techknight

Well-Known Member
Licensed User
Longtime User
I keep getting a crash of:

EXCEPTION_ACCESS_VIOLATION (0xc0000005)

Which basically crashes the entire JVM, and its being caused by the Serial.Open

Googling reveals that this is a problem with JSSC being dependent on some files that do not exist on windows 10, as per this thread here: https://github.com/scream3r/java-simple-serial-connector/issues/116

I was wondering if anyone has fixed this for B4J?
 
Last edited:

techknight

Well-Known Member
Licensed User
Longtime User
Thanks for the advice, but thats more of a work-around instead of an actual fix. 32bit is going the way of the Dodo as each day passes. Anything newer than Java 8 doesnt even have 32 bit.

How does something like this get fixed?
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I'm going to quote myself (and @Zlgo ) from here (https://www.b4x.com/android/forum/threads/serial-port-demo-crashes.94618/#post-605525):
Zlgo said:
It looks like only option is to wait for resolving bug (some compatibility if I understand well) in JSSC lib.
Good luck. The last time this was updated was January 2014. I think if you want 64 bit compatibility, then
1) hopefully find another library
2) modify the code on your own
If successful with either #1 or #2, post a link to the updated library to the forum, since this has been a long and ongoing issue with JSSC.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I see. So is the source code of JSSC DLL available?

If so, then maybe a trip to the MSDN for migration information on serial ports from Win7 and older, to Win10 might reveal the issue. Or maybe simply a recompile on the modern OS with updated C++ runtimes fixes it, I dunno.

I dont know any of those languages so anything I do would be a crapshoot anyways. But maybe not, as I was able to fix my dylib for Mac OS for a USB dongle I have by simply recompiling on the target OS.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Fixed it!

replaced the JSSC dll with a more recent recompiled one, it was missing a couple depencies so I grabbed those DLLs and put them in my app folder, while replacing the native dll with the newer one.

its running! x64 Java 10.0.2 currently. I cant get Java 11 to work at all. Keeps throwing JavaFX missing errors, even Erel's download from the tutorial is doing the same thing, although I have NOT recompiled against Java 11. Just Java 8.

I do get a native vs java version mismatch on jssc, 2.8 vs 3.2 But it works!
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Yes, but it wont work without a couple of additional DLL files. Those files have to be in the Objects folder based on my tests.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I recompiled the DLL once again removing the other external runtime DLL dependency requirements.

I Left it at 2.8.0 in case the GIT repository eventually gets updated. However this will require you to clear the .jssc cache out of your User folder in windows.

Everything is still working fine. Will upload shortly.

In case anyone ever wants to recompile it themselves, you can use this: (modify paths to your own)

Compiler: MinGW W64

B4X:
g++ -Wall -D_JNI_IMPLEMENTATION_ -Wl,-kill-at -static-libgcc -static-libstdc++ jssc.c++ -shared -m64 -o jSSC-2.8_x86_64.dll -I "C:/Program Files/Java/jdk1.8.0_191/include" -I "C:/Program Files/Java/jdk1.8.0_191/include/win32"
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
In case anyone is curious, This is the project I am working on that I needed this for. One of my biggest B4J projects as of yet. And its in use currently at the school.

CMS3K.png

A link to the video of this thing in action (shown at various times during game)

https://www.pscp.tv/w/1YqxorPQlWvJv
 
Upvote 0

Chris2

Active Member
Licensed User
Longtime User
Uploaded fixed jssc.jar, this one is solved folks.
Can someone please point me to this fixed jssc.jar?
The repository seems to have the latest file dated 2014.

I'm having the same problem with jSerial crashing under OpenJava11. As suggested by Erel here and in other threads, it works OK if I use a 32 bit Java 8 but I'd like to use OpenJava11 64 bit if possible.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
its not in the repository. I have no control over that repository. its posted here in the libraries section somewhere.
 
Upvote 0
Top