I am migrating a huge monolith application from java 1.7 to 12 and I want to do it the right way with as little hacks as possible. I keep, rightfully, running into errors such as this :
[ERROR] /home/idiot/projects/projects/blah/blah/src/blah/blah/blah/Blah.java:[8,18] package sun.nio.cs.ext is not visible
and
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project blah: Compilation failure
[ERROR] /home/idiot/projects/blah/blah/src/blah/blah/blah/Bblah.java:[152,42] package com.sun.org.apache.xerces.internal.dom is not visible
[ERROR] (package com.sun.org.apache.xerces.internal.dom is declared in module java.xml, which does not export it)
and warnings such as this
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.google.common.base.internal.Finalizer (file:/home/idiot/.m2/repository/own/plugin/own-plugin-1.jar) to field java.lang.Thread.inheritableThreadLocals
WARNING: Please consider reporting this to the maintainers of org.python.google.common.base.internal.Finalizer
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
Modularising this behemoth of a web app seems impossible, without even a proper tutorial to look up. Most of google and stack results are solutions applicable to pre java 11 environments. Most of google-fu recommends using the right package instead of the one which is now hidden/obsolete.
The challenge and my question is, how do I find out what a now obsolete API is replaced with ?
There are hundreds and thousands of files using reflections, com.sun.org
, sun.misc
packages, once the steps to find the replacement packages is figured, how to go about addressing this? Just manually go through thousands of files and update ?