B4J Question Can't test B4J

GGSoft

Member
Licensed User
Longtime User
As an intensive user of B4A and B4i I decided try B4J. I tried to run an "empty" project (by "empty" I mean "as born") and I get an horrendous error.

This is the project:
B4X:
#Region  Project Attributes 
    #MainFormWidth: 600
    #MainFormHeight: 400 
#End Region

Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.SetFormStyle("UNIFIED")
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Show
End Sub

And these are the logs:
B4X:
Program started.
main._process_globals (java line: 72)
java.lang.NoClassDefFoundError: javafx/scene/control/Dialog
    at b4j.example.main._process_globals(main.java:72)
    at b4j.example.main.initializeProcessGlobals(main.java:63)
    at b4j.example.main.start(main.java:33)
    at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
    at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:219)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:182)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:179)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
    at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: javafx.scene.control.Dialog
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 14 more

I wonder what can be happening :(

Regards.
 

GGSoft

Member
Licensed User
Longtime User
You need to use Java 8u40+ (Tools - Configure Paths).
Thank you, Erel. I had 8u91 but only in the JRE. I thought I was up to date in the JDK also. I installed 8u91 and I'm ready to play & learn.

Regards.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Thank you, Erel. I had 8u91 but only in the JRE. I thought I was up to date in the JDK also. I installed 8u91 and I'm ready to play & learn.

Regards.
While you are at it, and if you have an interest in hooking your B4A and B4i apps into a server with modern webapps, checkout the ABMaterial framework.
Without knowing diddly jack squat about B4J, I dove into ABM and learned a great deal about B4J at the same time.
However, I am still a dummy, just a lot less of one... ask anyone...

Best of luck and happy learning.
 
Upvote 0
Top