Feb 5, 2026 Replies: 2 As I didn't find anything on the forum regarding this error and it took me a while to solve it, I'm posting this here. I was running a B4J program from the IDE on Linux (under wine) and ran into this exception when trying to execute a shell script with the jShell library, like: Code: Copy Dim shl As Shell shl.Initialize("shl", "myfile.sh", Array As String("a", "b", "c")) shl.RunSynchronous(-1) ' <----- This throws the exception; the same happened when using shl.Run I fixed it by 1. creating this script to run the jar natively, i.e. not from wine (change the paths to reflect your setup): Code: Copy #!/bin/bash java @release_java_modules.txt --module-path /home/me/java/jdk-14.0.1/javafx/lib --add-modules ALL-MODULE-PATH -Djdk.gtk.version=2 -jar /home/me/path/to/Objects/my.jar 2. copying file 'release_java_modules.txt' from the B4J installation directory to the directory that contains the above script Note: - The script works for both console and UI programs. - I added '-Djdk.gtk.version=2' some years ago to avoid the warning message 'XSetErrorHandler() called with a GDK error trap pushed. Don't do that.'. I found this on https://stackoverflow.com/questions/55446534/how-to-fix-java22494-gdk-warning ; it may be unnecessary. Click to expand...
As I didn't find anything on the forum regarding this error and it took me a while to solve it, I'm posting this here. I was running a B4J program from the IDE on Linux (under wine) and ran into this exception when trying to execute a shell script with the jShell library, like: Code: Copy Dim shl As Shell shl.Initialize("shl", "myfile.sh", Array As String("a", "b", "c")) shl.RunSynchronous(-1) ' <----- This throws the exception; the same happened when using shl.Run I fixed it by 1. creating this script to run the jar natively, i.e. not from wine (change the paths to reflect your setup): Code: Copy #!/bin/bash java @release_java_modules.txt --module-path /home/me/java/jdk-14.0.1/javafx/lib --add-modules ALL-MODULE-PATH -Djdk.gtk.version=2 -jar /home/me/path/to/Objects/my.jar 2. copying file 'release_java_modules.txt' from the B4J installation directory to the directory that contains the above script Note: - The script works for both console and UI programs. - I added '-Djdk.gtk.version=2' some years ago to avoid the warning message 'XSetErrorHandler() called with a GDK error trap pushed. Don't do that.'. I found this on https://stackoverflow.com/questions/55446534/how-to-fix-java22494-gdk-warning ; it may be unnecessary.
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2026 #2 A similar feature is implemented in RunJar: https://www.b4x.com/android/forum/threads/jarcaller-run-and-kill-b4j-jars.168284/
A similar feature is implemented in RunJar: https://www.b4x.com/android/forum/threads/jarcaller-run-and-kill-b4j-jars.168284/
W walt61 Well-Known Member Licensed User Longtime User Feb 5, 2026 #3 I'll have to check that one out, thanks @Erel