oracle / coherence

Oracle Coherence Community Edition
https://coherence.community
Universal Permissive License v1.0
426 stars 71 forks source link

Question - does Coherence now work on JDK17? #53

Closed javafanboy closed 2 years ago

javafanboy commented 2 years ago

I read somewhere that Coherence only worked with JDK8 - does this still apply or can it now work with more recent ones?

aseovic commented 2 years ago

Coherence has required Java 8 since 12.2.1 release in 2015, but it certainly works on newer releases as well. It is officially certified on Java 8 and 11 (we only certify against LTS Java releases), and GraalVM equivalents, but it is regularly tested against the latest Java release, including Java 17 (and its GraalVM equivalent).

That said, Java 17 does require some additional settings to work properly, primarily because of things that used to work with warnings, but now cause access errors.

This is what we use when running tests with Java 17 in order to resolve access issues:

--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED \
--add-exports java.management/sun.management=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED 

If you use Coherence with the Module System, you may be able to replace ALL-UNNAMED above with com.oracle.coherence, which is automatic module name for coherence.jar.

Unfortunately, as much as we'd like to add proper module support, we can't really do it without jumping through major hoops until we drop support for Java 8, so this is probably the best we can do for the time being.

javafanboy commented 2 years ago

Thanks a lot for the input Alek - will give it a try!