B4J Question [SOLVED] B4Xpages app: B4J layout file error java.lang.RuntimeException: java.io.FileNotFoundException: MainPage.bjl

peacemaker

Expert
Licensed User
Longtime User
HI, All

Already 2-3 times i have found that some B4J project (not all) give the error that cannot find the main layout file after compilation in Release mode.
Debug mode works OK.
B4A part of the B4Xpages project also compiled OK.
OpenJDK 11.
B4J Version: 9.30
Parsing code. (0.26s)
Java Version: 11
Building folders structure. (0.01s)
Running custom action. (0.06s)
Compiling code. (0.41s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code.
b4xpagesmanager._vvvvvvvvvvvvvvv4 (java line: 302)
java.lang.RuntimeException: java.io.FileNotFoundException: MainPage.bjl
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:518)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:464)
at b4j.example.b4xpagesmanager._vvvvvvvvvvvvvvv4(b4xpagesmanager.java:302)
at b4j.example.b4xpagesmanager._vvvvvv1(b4xpagesmanager.java:717)
at b4j.example.b4xpagesmanager._vvvv6(b4xpagesmanager.java:114)
at b4j.example.b4xpagesmanager._vvvv7(b4xpagesmanager.java:121)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:486)
at b4j.example.main._appstart(main.java:59)
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.BA.raiseEvent(BA.java:96)
at b4j.example.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
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:834)
Caused by: java.io.FileNotFoundException: MainPage.bjl
How to understand what is the trouble ?
 

peacemaker

Expert
Licensed User
Longtime User

Attachments

  • TempDownload.png
    TempDownload.png
    22.7 KB · Views: 95
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Opps. My manual start shows:
java -jar TrendUtils.jar
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.UnsupportedClassVersionError: b4j/example/main has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

1637075964169.png

p:\GoogleDrive\!Sources\!\TrendUtils\TrendUtils\B4J\Objects>java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode, sharing)
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Looks so ! But how to install JDK11 under Win10, if B4X recommended bundle is not the installer ?
JAVA_HOME is set to the recommended OpenJDK11.
1637076643806.png
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
I uninstalled old Java 1.8. OpenJDK 11 unzipped again (to the same "d:\Programs\Java\jdk-11.0.1"), and it was not changed.
But manual start now gives:
d:\Programs\Java\jdk-11.0.1\bin>java -jar TrendUtils.jar
Error: JavaFX runtime components are missing, and are required to run this application
Debug mode is working OK, as usual. But not release.

Only one is clear - it's only my PC is with trouble.
Thanks to all, will google.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
command line using this
java --module-path ..\javafx\lib\ @"D:\Programs\B4J\release_java_modules.txt" -jar TrendUtils.jar
Thanks, Erel ! Such way - yes, app is started OK from JAR at my PC also.
But why no start (not found the Layout file) in Release mode from B4J ...
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Does it work once it is packaged?
Yes, it's started manually as you suggested from the command line and works fully OK.
I tried some other B4J projects - some starts OK in Release mode, some - no, like this. With native views, and B4Xviews, no difference... Very strange situation.
If to create the default empty projects by "File"-menu (UI and B4XPages) - they both start OK in Release mode.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
SOLVED !
Deleted "Objects" folder, and re-compilation in Release mode ... works !
 
Upvote 0
Top