I know nothing about Java as I have a list a mile long of languages I know and therefore I don't need any more on the list. I'm only interested in B4J because I am 77 (i.e. retired) and run out of things I want to do with Lazarus and I used to be a Basic4PPC user! So...
Once upon a time I used to use Version 8 of JDK but at some stage some app I was installing said it wanted JDK-24 so I dutifully started using that instead. Other apps that need Java didn't complain. So when I recently downloaded B4J I took the web site's advice that if I already had JDK I didn't need to reacquire and reinstall. Yesterday I finally got round to actually using B4J so followed the documentation and create MyFirstProgram. On trying to compile I got the following result...
****************************
B4J Version: 10.70
Parsing code. (0.02s)
Java Version: 8
Building folders structure. (0.01s)
Running custom action. (0.04s)
Compiling code. (0.06s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
src\B4J\MyFirstProgram\main.java:7: error: package javafx.application does not exist
public class main extends javafx.application.Application{
^
1 error
only showing the first 1 errors, of 7 total; use -Xmaxerrs if you would like to see more
javac 24.0.1
Tip: press Ctrl + R to export IDE state for AI assistants.
************************************************
After poking around on my system and not finding an answer I decided to follow the link from the B4X web site for downloading JDK. I found that that version 19 was being specified. So I downloaded that and lo, MyFirstProgram compiled and ran! But that means I need to be running two versions of JDK as the version 19 download is a "portable" version requiring no installation so other apps don't know it is there so I still need to have version 24 installed!
Yes I know version 24 is not the latest, but it works perfectly with everything else I've got. But further investigation of the Java website says that end users like me should still be using version 8! Really??? And why does that error message say Java Version 8 when it is version 19 that that download link specifies?
So why has the javafx.application.Application package disappeared from later versions of JDK? I suspect it may be because there is now a separate product OpenFX and they thought having an unrelated package with an fx suffix might be confusing. So maybe it is possible that that package is still in the JDK but using a different name? Perhaps a Java expert out there would know? If that is the case, sadly B4J should be given the extra ability to cope with both situations. Otherwise it needs to be made clear that versions of JDK after whatever number was the first to drop javafx are not suitable.
Once upon a time I used to use Version 8 of JDK but at some stage some app I was installing said it wanted JDK-24 so I dutifully started using that instead. Other apps that need Java didn't complain. So when I recently downloaded B4J I took the web site's advice that if I already had JDK I didn't need to reacquire and reinstall. Yesterday I finally got round to actually using B4J so followed the documentation and create MyFirstProgram. On trying to compile I got the following result...
****************************
B4J Version: 10.70
Parsing code. (0.02s)
Java Version: 8
Building folders structure. (0.01s)
Running custom action. (0.04s)
Compiling code. (0.06s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
src\B4J\MyFirstProgram\main.java:7: error: package javafx.application does not exist
public class main extends javafx.application.Application{
^
1 error
only showing the first 1 errors, of 7 total; use -Xmaxerrs if you would like to see more
javac 24.0.1
Tip: press Ctrl + R to export IDE state for AI assistants.
************************************************
After poking around on my system and not finding an answer I decided to follow the link from the B4X web site for downloading JDK. I found that that version 19 was being specified. So I downloaded that and lo, MyFirstProgram compiled and ran! But that means I need to be running two versions of JDK as the version 19 download is a "portable" version requiring no installation so other apps don't know it is there so I still need to have version 24 installed!
Yes I know version 24 is not the latest, but it works perfectly with everything else I've got. But further investigation of the Java website says that end users like me should still be using version 8! Really??? And why does that error message say Java Version 8 when it is version 19 that that download link specifies?
So why has the javafx.application.Application package disappeared from later versions of JDK? I suspect it may be because there is now a separate product OpenFX and they thought having an unrelated package with an fx suffix might be confusing. So maybe it is possible that that package is still in the JDK but using a different name? Perhaps a Java expert out there would know? If that is the case, sadly B4J should be given the extra ability to cope with both situations. Otherwise it needs to be made clear that versions of JDK after whatever number was the first to drop javafx are not suitable.