Java 17 compatibility
Description
Environment
Activity
Björn Harrtell October 2, 2021 at 1:27 PM
I believe I’ve managed to solve the illegal reflective access for coverage and imagemosaic modules and that this is now ready. :)
Frank Gasdorf August 29, 2021 at 11:24 AM
added a link to related issue https://osgeo-org.atlassian.net/browse/GEOT-6967 regarding illegal reflective access which occured starting uDig with Java 11 and GeoTools 22.1. My read is that this warning will nbot be a warning in Java 17 anymore. Therefore it should be fixed, if coverage support is required.
Björn Harrtell August 25, 2021 at 4:17 PM(edited)
GeoTools main appears to compile fine with Java 17 using the same incantation as what works out of the box with Java 11:
cd build
mvn install
cd ..
mvn compile
On to the tests. I get these four errors:
[ERROR] Errors:
[ERROR] NetCDFAggregationTest.testJoinExisting:71 » Runtime java.io.IOException: java....
[ERROR] NetCDFAggregationTest.testJoinReversed:113 » Runtime java.io.IOException: java...
[ERROR] NetCDFCRSTest.testAutoConversionKmToM:526->setFinalStaticField:94 » NoSuchField
[ERROR] NetCDFCRSTest.testPreserveKM:507->setFinalStaticField:94 » NoSuchField modifie...
[INFO]
[ERROR] Tests run: 195, Failures: 0, Errors: 4, Skipped: 3
So perhaps not expected but, in theory and with only test coverage based assessment, it looks like GeoTools already works (!) with Java 17 except for the NetCDF gridcoverage module.
I will proceed creating the corresponding issue for GeoServer and see what fun things that will bring.
Andrea Aime August 25, 2021 at 9:13 AM
Oh yeah, please go ahead, it’s a bridge that we’ll have to cross eventually. Even just getting a partial laundry list of things that need changing is a great start.
Björn Harrtell August 25, 2021 at 8:56 AM
@Andrea Aime I have little insight into it but it tickles my interest and I will dive into it, assuming it’s a worthwhile goal. I would not be surprised if you are right in that it will not be an easy upgrade.
Java 17 is around the corner and is a LTS release. It would be good to be able to use it with GeoTools.
There are many benefits since Java 11 but my primary goal is to eventually be able to take advantage of JEP 346: Promptly Return Unused Committed Memory from G1 in GeoServer.