B4J Question Error when trying to run UI application that connects to jRDC2

vfafou

Well-Known Member
Licensed User
Longtime User
Hello!
I'm trying to run a UI application with executable created with integrated B4J packager.
When I double click to run the .exe my initial form is instantly drawed on the screen and closes immediately!
Running the run_debug.bat I have the following error:
B4X:
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
httputils2service._service_create (java line: -1)
java.lang.NoClassDefFoundError: java/util/logging/Logger
        at b4j/okhttp3.internal.platform.Platform.<clinit>(Unknown Source)
        at b4j/okhttp3.OkHttpClient.newSslSocketFactory(Unknown Source)
        at b4j/okhttp3.OkHttpClient.<init>(Unknown Source)
        at b4j/okhttp3.OkHttpClient$Builder.build(Unknown Source)
        at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper.Initialize(Unknown Source)
        at b4j/com.vf.zooland.httputils2service._service_create(Unknown Source)
        at b4j/com.vf.zooland.httputils2service._submitjob(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.keywords.Common.CallSub4(Unknown Source)
        at b4j/anywheresoftware.b4a.keywords.Common.access$0(Unknown Source)
        at b4j/anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.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)
Caused by: java.lang.ClassNotFoundException: java.util.logging.Logger
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 22 more
Thank you in advance!
 

vfafou

Well-Known Member
Licensed User
Longtime User
Yes, I do!
 

Attachments

  • Screenshot 2021-11-02 092257.png
    Screenshot 2021-11-02 092257.png
    66.1 KB · Views: 142
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Hello, Erel!

This is a cut from my project without any additional libraries except jMetro.
If you make a Standalone Package and run the run_debug.bat, you will see the exception from my first post and the exceptions for jMetro from my other thread:
I have attached the jMetro library too!

Thank you in advance!
 

Attachments

  • ZooLand.zip
    294.6 KB · Views: 137
  • jmetro-11.6.15.jar
    83.8 KB · Views: 150
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Oh! I'm really sorry!
I accidentally removed the stockUtils initialization from the demo!
The same error is appeared when I have it initialized.
It is initialized at addPages into B4XMainPage.
 

Attachments

  • ZooLand.zip
    294.6 KB · Views: 149
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
UPDATE!!!

I've found that running the jar with java.exe with the following args, the app is running perfectly!
B4X:
java --module-path "C:\java\11.0.1\javafx\lib" --add-modules=javafx.controls -jar "C:\dev\B4X\Projects\Zooland 0.9\B4J\Objects\Zooland.jar"
How to configure packager call java with these args?
 
Last edited:
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Hello!
Is it possible to configure the packager to call java with these args?
Thank you in advance!
 
Upvote 0
Top