Wish Update OpenJDK

Peter Simpson

Expert
Licensed User
Longtime User
I've been using OpenJDK 14 + OpenJFX 14 from Erels beta release post for a couple of years now for all my B4X projects, it works perfect.

My wish is simply to hope that Anywhere Software updates to OpenJDK 18 + OpenJFX 18 sooner rather than later, especially as the B4A and B4J download pages still use OpenJDK 11 + OpenJFX 11 when OpenJDK 14 + OpenJFX 14 from the forum works perfectly well on all my cross platform projects.


Thank you...
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that you can use any version of OpenJDK you like. You just need to download the three pieces and put them in the right place:
- OpenJDK
- JavaFX SDK + jmods: https://gluonhq.com/products/javafx/

JavaFX SDK should be in javafx folder.
JavaFX jmods should be in javafx\javafx-jmods folder
 

Peter Simpson

Expert
Licensed User
Longtime User
Thank you for that @Erel

B4J and B4A both reports the same Java Version 8 (but configure paths are both pointing to OpenSDK 18.0.1 folder), but B4A compiles where as B4J fails.
1651055571660.png

The bottom of the compile windows does show 'javac 18.0.1' though

Working with Java Version 14 (OpenSDK 14.0.1)
1651055644407.png


No need to respond to this post, I just thought that I would let you know...
 

Sagenut

Well-Known Member
Licensed User
Longtime User
In a test I was able to create the OpenJDK 17 package.
It was working for B4J (not tested deeply) but not for B4A.
 

Peter Simpson

Expert
Licensed User
Longtime User
In a test I was able to create the OpenJDK 17 package.
Hmm that's interesting to know, cheers.

I do find this strange as B4X configure path is clearly pointing to this file, but whilst compiling the build windows shows Java Version 8 instead of Java Version 18.x???

File that B4X IDE's are pointing to.
1651057852599.png


Edit: Update - I've just tried it again but this time with OpenSDK 17.0.1, but both B4A and B4J are still display Java Version 8 in the build window. B4J does not compile where as B4A compiles perfectly fine.

Oh well...
 
Last edited:

Sagenut

Well-Known Member
Licensed User
Longtime User
If possible I would ask @Erel to provide the complete new JDK package when supported.
As it was done with 11 and 14.
Thanks
 

Peter Simpson

Expert
Licensed User
Longtime User
If possible I would ask @Erel to provide the complete new JDK package when supported.
As it was done with 11 and 14.
Thanks

This should work once the B4A and B4J IDE's have been updated. I deliberately left B4i on OpenJDK 11 because I could not get it compiling with OpenJDK 14.

Ignore the folder name, it is in fact OpenJDK 18.
 

mcqueccu

Well-Known Member
Licensed User
This should work once the B4A and B4J IDE's have been updated. I deliberately left B4i on OpenJDK 11 because I could not get it compiling with OpenJDK 14.

Ignore the folder name, it is in fact OpenJDK 18.
OpenJdk 18 still reads java 8 in the B4J 9.8 beta
 

Tecuma

Member
Licensed User
Will there be support for the latest Java LTS version 17 included or is this planned for version 21?
I know these kind of questions can be annoying but I prefer to work with LTS versions.
For the people who are interested here is a link to the JAVA roadmap from Oracle so you have an overview.
 

mcqueccu

Well-Known Member
Licensed User
True. I've now updated the utility that finds the version. It will be included in the next beta.

You can download it and put in the installation folder - NOT in the libraries folder.
Tested and it works fine. But the IDE reads it as Java 8 in the compiler window
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Works fine here:

B4J Version: 9.80 BETA #2
Parsing code. (0.00s)
Java Version: 18
Building folders structure. (0.01s)
Compiling code. (0.00s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. (0.53s)
Building jar file. (0.02s)
Jar file created: C:\Users\H\Downloads\projects\t\Objects\t.jar
Running application. (0.00s)
Completed successfully.

You can also explicitly set the version with:
B4X:
#JavaCompilerPath: 18, C:\java\jdk-18\bin\javac.exe
 

mcqueccu

Well-Known Member
Licensed User
I followed step 2 but
Works fine here:

B4J Version: 9.80 BETA #2
Parsing code. (0.00s)
Java Version: 18
Building folders structure. (0.01s)
Compiling code. (0.00s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. (0.53s)
Building jar file. (0.02s)
Jar file created: C:\Users\H\Downloads\projects\t\Objects\t.jar
Running application. (0.00s)
Completed successfully.

You can also explicitly set the version with:
B4X:
#JavaCompilerPath: 18, C:\java\jdk-18\bin\javac.exe

Solved.
I think the VersionFinder.jar was not included in the Beta 2 IDE.
So when I updated to 9.8 Beta 2, the version finder I copied to the install directory earlier was overwritten.

I just copied it back and it worked
 

MichalK73

Active Member
Licensed User
Longtime User
This should work once the B4A and B4J IDE's have been updated. I deliberately left B4i on OpenJDK 11 because I could not get it compiling with OpenJDK 14.

Ignore the folder name, it is in fact OpenJDK 18.
Hey.
I was just thinking why some of the servers stopped working properly for me with the API after OkHttptlis. I was simply compiled on an old version of Java 11.

This version that you gave me does not compile the project with websocket, I had to take from the
https://jdk.java.net/18/

Java 18 and everything was back to normal.

Thanks to you guys.
 
Top