In JDK 8, a new command-line tool, jdeps, is added that developers can use to understand the static dependencies of their applications and libraries. It also provides an -jdkinternals option to find dependencies to any JDK internal APIs that are unsupported and private to JDK implementation (see Why Developers Should Not Write Programs That Call 'sun' Packages).
Simple way to run jdeps to find out if your library/application depends on any JDK internal API:
See the jdeps man page for more information. jdeps is a static analysis tool on the given class files and dynamic class dependencies (Class.forName or loading of service providers etc) are not reported.
Below lists some of the JDK internal APIs and the recommended way to replace their usage.
|JDK internal API||Supported API||Note|
|sun.misc.Unsafe||TBD||A JEP will be submitted to define a supported API|
|sun.reflect.Reflection.getCallerClass||TBD||A JEP will be submitted to define a supported API|