I get this error when trying to run a built Exe
I have
in my JSON configuration file.
ETA:
The method called:
B4X:
class anywheresoftware.b4j.object.JavaObject (in module b4j) cannot access class sun.awt.SunToolkit (in module java.desktop) because module java.desktop does not export sun.awt 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/uk.sensible.mtdvat.hmrcheaders._screeninfo(Unknown Source)
at b4j/uk.sensible.mtdvat.hmrcheaders$ResumableSub_RefreshHeaders.resume(Unknown Source)
at b4j/anywheresoftware.b4a.BA.checkAndRunWaitForEvent(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
at b4j/anywheresoftware.b4a.keywords.Common$3.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 have
B4X:
IncludedModules: ["java.desktop"],
in my JSON configuration file.
ETA:
The method called:
B4X:
Private Sub ScreenInfo As String
Dim ScreenDef As String = ""
Dim ScreenWidth As String = ""
Dim ScreenHeight As String = ""
Dim ScreenColorDepth As String = ""
Dim JOToolKit As JavaObject
Dim JOGraphicsEnvironment As JavaObject
JOGraphicsEnvironment.InitializeStatic("java.awt.GraphicsEnvironment")
JOGraphicsEnvironment = JOGraphicsEnvironment.RunMethodJO("getLocalGraphicsEnvironment",Null)
JOToolKit.InitializeStatic("java.awt.Toolkit")
JOToolKit = JOToolKit.RunMethodJO("getDefaultToolkit",Null)
ScreenWidth = SU.EncodeUrl("width","US-ASCII") & "=" & SU.EncodeUrl(APSU.SubstringBefore(JOToolKit.RunMethodJO("getScreenSize",Null).RunMethod("getWidth",Null),"."),"US-ASCII")
ScreenHeight= "&" & SU.EncodeUrl("height","US-ASCII") & "=" & SU.EncodeUrl(APSU.SubstringBefore(JOToolKit.RunMethodJO("getScreenSize",Null).RunMethod("getHeight",Null),"."),"US-ASCII")
ScreenColorDepth = "&" & SU.EncodeUrl("colour-depth","US-ASCII") & "=" & SU.EncodeUrl(JOGraphicsEnvironment.RunMethodJO("getDefaultScreenDevice",Null).RunMethodJO("getDisplayMode",Null).RunMethod("getBitDepth",Null),"US-ASCII")
ScreenDef = ScreenWidth & ScreenHeight & ScreenColorDepth
Return ScreenDef
End Sub
Last edited: