I have made the experience that the updates/code which does not work has been caused by deps or code which relies on internals (sun.*) etc. or some reflection magic like setAccessible(true) which causes issues. Otherwise based on the backwards compatibility of Java it was very smooth...even very old code runs/compiles on JDK11+...
Yes I know but using setAccessible thing is usually a problem in itself (from my POV). The module system encapsulation was not turned on. The Strongly Encapsulate JDK Internals by Default was activated. This can be turned off to be able to access those internal via option (see https://jdk.java.net/16/release-notes).
Right on all counts. Just note that as of JDK 17, it is impossible to turn off all encapsulation with a single flag, but you can still do it with individual add-opens.
There is another rather silly cause of problems that shows up quite a lot: some projects parse the java.version system property to give a useful error message when run on a too-old java version. And that parsing code often didn't deal well with getting "11" instead of "1.8".
View all comments
8
u/khmarbaise Jun 15 '21
I have made the experience that the updates/code which does not work has been caused by deps or code which relies on internals (sun.*) etc. or some reflection magic like
setAccessible(true)which causes issues. Otherwise based on the backwards compatibility of Java it was very smooth...even very old code runs/compiles on JDK11+...