-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building with Java 21 #655
Comments
Hey, thanks for your interest in chart-fx and sharing your findings here. That looks like there was some API changes with That being said we are of course interested in following the development of the java ecosystem and making sure we can successfully compile also on the newest source level. At the same time, as a library we try not to force our users too much into the bleeding edge, but most of the changes usually can be made in a backwards compatible way. I'll have to find some time to look into this, but if you have made or make progress on this in the meantime, feel free to share it here and/or open a PR. Last but not least, we're always interested in understanding how and where chartfx is being used, so if you can share some information about your use of chartfx, feel free to share some info and/or screenshots about what you are building/what you built/are building: https://github.com/fair-acc/chart-fx/discussions/categories/show-and-tell |
The reason for this compilation issue is described in detail here: https://inside.java/2023/05/12/quality-heads-up/ If the ObservableDeque.reversed() method is not used anywhere then a simply implementation throwing an UnsupportedOperationException might be all that is needed. This is how I implemented it:
For this approach we do not even have to change the compiler level settings in the project. Only drawback is that we cannot annotate the method with "Override" as that would fail in older Java versions. |
BTW, several samples also fail when running with Java 21 as they are using reflections that are clashing with the module system. I think it would be a good idea to move the project at least to the module system and to assume JDK 17 as the minimum. |
I did multiple attempts at moving to the module system, but the problem was always that there were (and probably are) still some dependencies that are not yet modularized and the articles I read back then all made this a prerequisite (the only way out being maven plugins that basically repackage the unmodularized dependencies). Since this was now 4 years ago, a lot might have changed, but back then I put a lot of time into this only to realize that it could not work for us. I don't think dropping jdk11 should be a big deal by now 👍 |
This is indeed not an issue. I constantly use the module system with third party libs that are not modularised, yet. |
I have Java Version 21 (Bell Soft). When I clone the repository - I have modified the top level pom.xml to the correct JAVA targets to 21.
I have also modified JaCoCo dependency to the latest version which supports Java 21. However compilation fails with the following when building charts - is there a solution to overcome this
The text was updated successfully, but these errors were encountered: