B4J Question java 12

Status
Not open for further replies.

GuyBooth

Active Member
Licensed User
Just "for fun" (I must be a masochist) I installed Java12 release candidate.
The immediate reaction from compiling a B4J project was a compile error:
"error: module not found: javafx.swing".
Is this a concern for the upcoming release? Is there an easy workaround?
 

OliverA

Expert
Licensed User

GuyBooth

Active Member
Licensed User
Install JavaFX separately
Installed the JavaFx 12 sdk from Gluon. When I compile my app I now have an error:
B4X:
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
[Edit note: This is only in debug mode. In release mode, there are no apparent errors]
 
Last edited:

ThRuST

Well-Known Member
Licensed User
@GuyBooth You can still use Java 8 and swing components if you stay with JDK v9.0.4 and create an installer package for Java 11.
Just make sure that you add the neccessary parameters at runtime. Search the forum to find out how this is done.
 

OliverA

Expert
Licensed User

ThRuST

Well-Known Member
Licensed User
@OliverA I am "stuck" with JDK v9.0.4 mainly because of my project which tend to take longer than expected to complete,
but that's not really a problem since I have heard that it should be possible to use packager11 with Java 8/9 supported parameters.

However I have not yet tested this myself, but according to experts in this forum who have tested this combo, it should work.
It would be nice to shed some light upon this as well, since Java 8/9 supported libraries are a major contribution for B4X.

EDIT: I would like to see a tutorial on how this works with Packager11, so please share a link for this.
 

OliverA

Expert
Licensed User
Java 11 is a LTS version
Please note that his will not be true for OpenJDK. OpenJDK is on a 6 month release cycle.
https://blog.codefx.org/java/java-11-migration-guide/#On-Releases-JDKs-And-Licenses
https://www.tomaszezula.com/2018/11/12/oracle-jdk-changes-to-the-release-cycle/
https://www.baeldung.com/oracle-jdk-vs-openjdk

If you are looking for an LTS version of OpenJDK that is not Oracle and has no license fees, you'll need to look at alternatives. One that promises LTS support is Amazon with Corretto (https://aws.amazon.com/corretto/). Others may exist. See the link in post#6 above (you'll have to check for yourself in regards to long time support options).
 

ThRuST

Well-Known Member
Licensed User
@OliverA :eek: Are you saying that Java 8/9 installers with Java 11 LTS version won't work in the next 6 month?
I was hoping that the JavaFX platform would be a waterproof choice for my project but ever since Oracle chosed to change direction
I cannot even create an installer to have my project released, what a shame. Three years of hard work down the drain, but hopefully not.
 

ThRuST

Well-Known Member
Licensed User
@OliverA
OpenJDK is on a 6 month release cycle.
My worry is that the LTS version will not run my application once the 6 month cycle expires.
My concerns can be covered in a new post as Erel recommends.
 

Erel

Administrator
Staff member
Licensed User
Please note that his will not be true for OpenJDK. OpenJDK is on a 6 month release cycle.
This statement is not correct. OpenJDK is an open source project and there are many companies that plan to continue and maintain it for many years.
You can read it in the posted link: https://blog.codefx.org/java/java-11-migration-guide/#On-Releases-JDKs-And-Licenses
And you can read it in this mailing list thread: http://mail.openjdk.java.net/pipermail/jdk-dev/2018-August/001823.html
 

ThRuST

Well-Known Member
Licensed User
@Erel Thanks for pointing this out. How many times have we all not installed software that needs dependencies like C++ runtime 2010, 2013 and 2015 because
we want to use some old application that we like and need. That makes me wonder why Java versions would not follow this trend. I mean, what's the point in
creating an application if it cannot be used because of Java framework has been upgraded. There must be a backward compatibility like Microsoft secured.

Sorry if this might balance to be off topic, but Oliver fueled my fears by saying that and it makes me wonder why Amazon Corretto saw the light of day in the first place
when there's open JDK. I can not be the only one who wonder about this. This post may be moved to my Corretto post if that is better, but I think this answer was relevant.
 

ThRuST

Well-Known Member
Licensed User
Erel said You should be able to use it if you organize it as B4J expects.
(How to add someones name to quotes?)

It's not only to install and reference to B4J like Open JDK 11/12? Perhaps you can provide a installer instructions on B4J page if Corretto is worth the trouble of course.
 

ThRuST

Well-Known Member
Licensed User
Btw @Erel What about the parameters for B4JPackager11 when referencing RNE for Java 8/9, can you please add instructions for that as well?
 
Status
Not open for further replies.
Top