-
-
Notifications
You must be signed in to change notification settings - Fork 489
OSGeo Java codesprint 2018
Regarding the OSGeo Java 2018 CodeSprint.
Java is evolving a lot now. Both in how the language works and in the support of previous versions.
With the faster release cadence, a new strategy was required for delivering updates. Oracle now produce two JDK binaries: the traditional Oracle JDK and one built purely from OpenJDK source. By JDK 11 these will be functionally equivalent but not so from the perspective of updates. Each OpenJDK binary will only have updates (security patches and bug fixes) for six months, until the release of the next JDK. The Oracle JDK will have a long-term support (LTS) release every three years. JDK 8 is currently an LTS; the next will be JDK 11.
Conclusion: We should move to Java 11 version.
Major changes that break backwards compatibility were introduced mostly in Java9, so the effort would be the same (and Java9 is also out of support).
Actually, Oracle JDK’s build process builds from OpenJDK source code. So there is no major technical difference between Oracle JDK and OpenJDK.
Conclusion: They are the same. Use OpenJDK as reference.
Strategy:
- Run an existing Java application with JDK 11.
- Compile the application with Java 11.
- Modularize the application to use Module System.
Check if GeoNetwork is compatible seamlessly. TL;DR: No.
- As expected, Spring fails to load.
- Warning on reflection:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
Installing OpenJDK 11 and try to run maven fails:
- Missing javax classes (and probably even more missing/moved core JDK classes).
- Warning on reflection:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
This list may not be complete.
- Replace Spring with latest version: from 3.2.0 to 5 https://jira.spring.io/browse/SPR-16391
- Locate and replace all imports referencing missing JDK API
- Replace other dependencies that may be struggling with JDK 11
- Check all reflection
- "Get rid" as much as possible of Jeeves
- Migrate all remaining services to REST/API
- Remove old/no longer used services
This is the list of things that would be nice to have, but are not really mandatory (yet).
- Move to the new module/jigsaw from classpath
Hard to say.
Spring 5 is compatible with Java 8. But the importing of the core JDK libraries and changes on the code for reflection...
If you have some comments, start a discussion, raise an issue or use one of our other communication channels to talk to us.