B4J Question B4JPackager11 & com.sun.glass.ui.Application

tohtics

Member
Licensed User
Hi!

I followed the information in https://www.b4x.com/android/forum/threads/resolved-illegalaccessexception.105285/#post-659517, my program works in the IDE in release mode, but no when runs after i use b4jpackager11, the app. I got the same error in the instruction:

B4X:
Sub initRobot
    robot = temp.InitializeStatic("com.sun.glass.ui.Application").RunMethodJO("GetApplication",Null).RunMethodJO("createRobot",Null)
End Sub

error:

parrillaprogramacion._initrobot (java line: -1)
java.lang.IllegalAccessException: class anywheresoftware.b4j.object.JavaObject (in module b4j) cannot access class com.sun.glass.ui.Application (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.ui to module b4j
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Unknown Source)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at b4j/anywheresoftware.b4j.object.JavaObject.RunMethod(Unknown Source)
at b4j/anywheresoftware.b4j.object.JavaObject.RunMethodJO(Unknown Source)
at b4j/b4j.example.parrillaprogramacion._initialize(Unknown Source)
at b4j/b4j.example.formaprincipal._ponuiparrilla(Unknown Source)
at b4j/b4j.example.parrillaprogramacion._initrobot(Unknown Source)
at b4j/b4j.example.formaprincipal._menubar1_action(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$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)

I modified the release_java_modules.txt file,

B4X:
--add-opens java.desktop/sun.awt=b4j --add-opens javafx.controls/com.sun.javafx.scene.control.inputmap=b4j --add-opens javafx.graphics/com.sun.javafx.scene=b4j --add-opens javafx.controls/com.sun.javafx.scene.control.behavior=b4j --add-opens javafx.graphics/com.sun.javafx.scene.traversal=b4j --add-opens javafx.graphics/javafx.scene=b4j --add-opens javafx.base/com.sun.javafx.collections=b4j --add-opens javafx.controls/com.sun.javafx.scene.control=b4j --add-opens javafx.base/com.sun.javafx.event=b4j --add-opens javafx.graphics/com.sun.javafx.css=b4j --add-opens javafx.base/com.sun.javafx.runtime=b4j --add-opens javafx.controls/com.sun.javafx.scene.control.skin=b4j --add-opens javafx.graphics/com.sun.javafx.geom=b4j --add-opens javafx.graphics/javafx.scene.canvas=b4j --add-opens javafx.graphics/com.sun.javafx.geom.transform=b4j --add-opens javafx.graphics/com.sun.glass.ui=ALL-UNNAMED
--add-modules=b4j,javafx.graphics,jdk.crypto.ec,java.base,java.desktop,java.instrument,java.logging,java.management,java.management.rmi,java.naming,java.rmi,java.security.jgss,java.sql,java.xml,javafx.base,javafx.controls,javafx.fxml,javafx.media,javafx.swing,javafx.web,java.scripting,jdk.unsupported,java.datatransfer,jdk.unsupported.desktop,jdk.jsobject,jdk.xml.dom

What else do i need to add to obtain a "good" app with B4jpackager11?

Regards
 
Top