I am new to B4J and I made a small app to test it
I know there is a recommended download package with openjdk + javafx, but i have openjdk 11.0.12 + javafx 11.0.2 and inside ide launch app work fine, and outside too. But if I add a CustomListView (I want to test muti-platform) then launching the app outside ide throws the following error:
orugacontrolador._mostrarpasos (java line: 217)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.customlistview._createlabel(customlistview.java:239)
at b4j.example.customlistview._insertattextitem(customlistview.java:704)
at b4j.example.customlistview._addtextitem(customlistview.java:82)
at b4j.myOruga.orugacontrolador._mostrarpasos(orugacontrolador.java:217)
at b4j.myOruga.b4xsolucionpage._llenardatos(b4xsolucionpage.java:225)
at b4j.myOruga.b4xsolucionpage._b4xpage_appear(b4xsolucionpage.java:78)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:509)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:489)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:563)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public static double com.sun.javafx.scene.control.skin.Utils.computeTextHeight(javafx.scene.text.Font,java.lang.String,double,javafx.scene.text.TextBoundsType) accessible: module javafx.controls does not "exports com.sun.javafx.scene.control.skin" to unnamed module @6b56a804
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
at b4j.example.customlistview.MeasureMultilineTextHeight(customlistview.java:1082)
... 26 more
the command I am using to launch the app outside B4J IDE is:
java --module-path %PATH_TO_FX% --add-modules javafx.controls,javafx.fxml -jar Oruga.jar
where %PATH_TO_FX% is an environment variable that point to my javafx installation folder and Oruga.jar is my app
Is worth to say that if I don't use the CustomListView component my app work fine with the above command.
Question is: How B4J IDE launch my app that the above error not happen.
I know there is a recommended download package with openjdk + javafx, but i have openjdk 11.0.12 + javafx 11.0.2 and inside ide launch app work fine, and outside too. But if I add a CustomListView (I want to test muti-platform) then launching the app outside ide throws the following error:
orugacontrolador._mostrarpasos (java line: 217)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.customlistview._createlabel(customlistview.java:239)
at b4j.example.customlistview._insertattextitem(customlistview.java:704)
at b4j.example.customlistview._addtextitem(customlistview.java:82)
at b4j.myOruga.orugacontrolador._mostrarpasos(orugacontrolador.java:217)
at b4j.myOruga.b4xsolucionpage._llenardatos(b4xsolucionpage.java:225)
at b4j.myOruga.b4xsolucionpage._b4xpage_appear(b4xsolucionpage.java:78)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:509)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:489)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:563)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public static double com.sun.javafx.scene.control.skin.Utils.computeTextHeight(javafx.scene.text.Font,java.lang.String,double,javafx.scene.text.TextBoundsType) accessible: module javafx.controls does not "exports com.sun.javafx.scene.control.skin" to unnamed module @6b56a804
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
at b4j.example.customlistview.MeasureMultilineTextHeight(customlistview.java:1082)
... 26 more
the command I am using to launch the app outside B4J IDE is:
java --module-path %PATH_TO_FX% --add-modules javafx.controls,javafx.fxml -jar Oruga.jar
where %PATH_TO_FX% is an environment variable that point to my javafx installation folder and Oruga.jar is my app
Is worth to say that if I don't use the CustomListView component my app work fine with the above command.
Question is: How B4J IDE launch my app that the above error not happen.