Starting with Java 8, the JDK ships a command line utility called jdeps (Java class dependency analyzer).
The jdeps command analyzes class dependencies and provides extra parameters to flag internal JDK packages.
While the WebSphere Migration Tool flags the majority of migration issues found in an application, the
jdeps tool can provide extra detection of internal JDK packages that are no longer available after migrating to
a new Java version.
We recommend you run the jdeps command as a final step after resolving issues flagged by the binary or source
WebSphere Migration Tools. Run the jdeps command against your application Java artifacts.
To ensure accurate results, use the jdeps command available in your planned target JDK installation, such as JDK 11, with the
-jdkinternals parameter. For example, after setting your environment to use Java 11, run the following command:
Starting with Java 9, an effort began to limit access to most JDK internals. However, to aid with migration, this strong encapsulation
was turned off by default for APIs that existed in Java 8. Starting in Java 16, the default value of the --illegal-access launcher
option is set to deny rather than permit. Although not recommended, this limitation could be bypassed in Java 16 by specifying
--illegal-access=permit. --illegal-access could also be set to warn
or debug to have the same effect as permit, but to issue a warning message while using warn and
stack trace for illegal reflective-access operations while using debug.
When migrating to Java 17 or later the --illegal-access launcher option is obsolete. Most JDK internals have now been strongly
encapsulated. Although not recommended, this limitation can be bypassed by using the --add-opens launcher option or Add-Opens
JAR manifest attribute to open specific packages that are required by your application or third-party libraries.
Certain critical internal APIs not encapsulated by this change include the following:
The utility generates output that identifies references to JDK internal classes and provides suggested
replacement APIs where possible.
Note: the jdeps command only accepts .class files, a directory, or a JAR file.
For more information on the jdeps command, see
the jdeps reference page.