Accessing internal APIs

The current Java platform encapsulates internal APIs to increase the security of the platform and applications written in Java. Applications that you program in Java 9, 10, or 11 will not have default access to the JDK's internal APIs, unlike previous versions of the Java platform. Oracle has identified some internal APIs as critical—those APIs remain accessible via the jdk.unsupported JDK module.

The aforementioned critical APIs (internal to the JDK) are as follows:

  • sun.misc
  • sun.misc.Unsafe
  • sun.reflect.Reflection
  • sun.reflect.ReflectionFactory.newConstrutorForSerialization

If you have pre-Java 9 applications that implement any sun.* or com.sun.* package, you will likely run into problems migrating your applications to the current Java platform. To address this issue, you should review your class files for use of sun.* and com.sun.* packages. Alternatively, you can use the Java dependency analysis tool, jdeps, to help determine whether your Java program has any dependencies on JDK internal APIs.

The jdeps tool is the Java dependency analysis tool; it can be used to help determine whether your Java program has any dependencies on JDK internal APIs.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset