B4J Question Java JDK19

Beja

Expert
Licensed User
Longtime User
Hi all,
Today I installed JDK 19 and when I tried to compile an old project I got this error message:

B4J Version: 9.80
Parsing code. (0.17s)
Java Version: 19
Building folders structure. (0.05s)
Compiling code. (0.44s)
Compiling layouts code. (0.04s)
Organizing libraries. (0.01s)
Compiling generated Java code. Error
B4J line: 56
icon1.Initialize(\
src\b4j\example\main.java:128: error: package javafx.scene.image does not exist
_icon1.Initialize(ba,"icon1",(javafx.scene.image.Image)(_img.getObject()),anywheresoftware.b4a.keywords.Common.ArrayToList(_menuitems));
^
1 error

Any meaning appreciated
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
JDK 11 provided here in the forum has the javafx module.

Since that version of java. JDKs doesn't have javafx included as default.

You have to install javafx manually.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Don’t use JDK 19. It’s a short term release and support ends in a few months time.

Use 11 or 17.

 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Don’t use JDK 19. It’s a short term release and support ends in a few months time.

Use 11 or 17.

Although I have to say that I have the JDK version and JAVAFX version 19.0.2 installed, and I have not had any problems.

1676523451586.png
1676523515218.png
 
Last edited:
Upvote 0

Tecuma

Member
Licensed User
In the output I can see
B4X:
src\b4j\example\main.java:128: error: package javafx.scene.image does not exist
I guess you use a JDK which does not have JFX. Either you use the JDK package from B4X or you should use a JDK which contain JFX.
E.g. I use the openjdk from Azul. On the download page I have to select the Java version and the content (with JFX or without).
Look here.

I agree with the comments before to use a LTS version, 11 or 17.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Although I have to say that I have the JDK version and JAVAFX version 19.0.2 installed, and I have not had any problems.
Yes you won’t have any problems compiling but there won’t be any more updates to JDK 19 in a few months. No security fixes, no bug fixes etc.

Given Javas security reputation do you really want to give your users an unsupported version of the JDK?
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Yes you won’t have any problems compiling but there won’t be any more updates to JDK 19 in a few months. No security fixes, no bug fixes etc.

Given Javas security reputation do you really want to give your users an unsupported version of the JDK?
Dear, I'm just testing the new versions of java.
For production applications I use Java 11 or 17.

See:
1676552386030.png
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
I just use 19 for trying out the new features like virtual threads etc.
It works in debug, Release and Packager fine.
 
Upvote 0
Top