Proposal: Bump minimum JDK version for JavaFX 20 to JDK 17
Johan Vos
johan.vos at gluonhq.com
Tue Jul 19 16:38:33 UTC 2022
First of all: there is often confusion when this is discussed (e.g.
on Twitter). We are only discussing the minimum JDK version for the code
in OpenJFX. JavaFX applications can of course declare stronger requirements
(e.g. Java 19 as a minimum).
I am rather cautious on bumping the minimum version too much/too high. For
my own development, I'm typically using EA-versions of the JDK. But for
something like OpenJFX, which should work on a large variety of platforms,
I prefer to be careful. Especially the less official platforms, e.g. iOS,
armv6,... might not have the best support for the latest JDK.
Granted, code snippets in Javadoc is not something that can be broken on
some platforms, so that particular feature would not be problematic. But in
general, I feel more confident sticking to LTS releases, as thore are more
likely to be maintained, supported, and ported to a wide variety of
platforms.
For a long time, there was an implicit rule to avoid Java 8 features in
OpenJFX as that broke the Android implementation. We are way beyond that
phase, and the situation on the mobile and embedded devices has improved
drastically, but I still prefer to be careful.
I believe the bumping decision should depend indeed on the added value of
features that have been added in new JDK releases.
- Johan
On Tue, Jul 19, 2022 at 4:34 PM Nir Lisker <nlisker at gmail.com> wrote:
> Why is the bump to JDK 17 and not 18? In 18 the feature for Code Snippets
> in Java API Documentation was added and it could be useful for any new API.
>
> Is the plan to continue to pump the minimum version with every release or
> once in several? Does it depend on the benefit the new features add?
>
> On Tue, Jul 19, 2022 at 4:44 PM Kevin Rushforth <
> kevin.rushforth at oracle.com> wrote:
>
>> Even though we build JavaFX binaries with JDK 18 as the boot JDK, the
>> latest version of JavaFX still runs with JDK 11 (and is capable of being
>> built using JDK 12 or later, and with some limitations, using JDK 11),
>> although it isn't tested with older JDK versions. In order for JavaFX to
>> be able to use newer JDK features, such as records, switch expressions,
>> text blocks, and so forth, we need to increase the minimum version of
>> the JDK that can run the latest JavaFX. Additionally, there is an
>> ongoing cost to keeping JavaFX buildable and runnable on older versions
>> of Java, and very little reason to continue to do so.
>>
>> To this end, I propose to bump the minimum version of the JDK needed to
>> run JavaFX 20 to JDK 17. I filed JDK-8290530 [1] to track this. This
>> will not affect update releases of earlier versions of JavaFX (e.g.,
>> JavaFX 17.0.NN), which will continue to run with the same minimum JDK
>> that they run on today.
>>
>> As a reminder, we only assure that JavaFX NN will run with JDK NN-1 or
>> later, although in practice, we haven't bumped the minimum required JDK
>> version in several releases. So, while JavaFX 19 is built using JDK 18
>> as the boot JDK, it produces class files that will run with JDK 11,
>> using "--source 11 --target 11". The proposed change discussed here
>> would update that in JavaFX 20 to "--source 17 --target 17".
>>
>> NOTE: this will not be an invitation to do wholesale refactoring of
>> existing classes or methods to use newer language features (e.g., a PR
>> that turns a bunch of existing data classes into records would not be
>> welcome). Rather, this can be seen as enabling judicious use of new
>> features in new code, much as we did when we started allowing the use of
>> "var".
>>
>> Absent a compelling reason to remain stuck in the past, I plan to send
>> out a pull request for this change next week.
>>
>> Comments are welcome.
>>
>> -- Kevin
>>
>> [1] https://bugs.openjdk.org/browse/JDK-8290530
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20220719/578b2789/attachment-0001.htm>
More information about the openjfx-dev
mailing list