Hi
SOLVED = See below
when executing following code (JavaObject lib is included)
receive error
SOLVED = See below
when executing following code (JavaObject lib is included)
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private nativeMe As JavaObject
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
' DO NOT USE as for B4A
' nativeMe.InitializeContext
' USE
nativeMe = Me
nativeMe.RunMethod("Test", Null)
End Sub
#If JAVA
public static void Test() {
System.out.println("Moin Moin");
}
#End If
receive error
B4X:
Program started.
main._appstart (java line: 53)
java.lang.NoSuchFieldException: sharedProcessBA
at java.lang.Class.getDeclaredField(Class.java:2062)
at anywheresoftware.b4j.object.JavaObject.InitializeContext(JavaObject.java:55)
at b4j.example.main._appstart(main.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.start(main.java:36)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$51/4360305.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/7100574.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/10819947.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/7135120.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/24247422.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Last edited: