Now that you know what are the possible problems you could face when compiling or running legacy code in Java 9, as well as how to solve those problems when they occur, let's spend some time understanding the scope of these problems. How worried should you be about having to encounter and fix these issues in your legacy Java code?
We can classify backward-incompatible APIs into the following broad categories:
- APIs with replacements: This link (also the link provided in the output of
jdeps --jdk-internals
) provides a complete list of APIs that need replacements in Java 9: https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool.
- Encapsulated APIs: When you run
jdeps
, you might see errors about usage of internal JDK types that do not have replacement suggestions. They could just be types that were formerly available pre-Java 9 but are now encapsulated in a platform module. These are fixable by using the right command line overrides to thejavac
andjava...