2

I have read question Classloaders hierarchy in Java 9 and also Java 9 migration guide (paragraph about Class Loader(CL) changes), but still did not get the clear difference between Extension CL and Platform CL. So I would kindly ask to avoid marking the question as a duplicate.

Regarding Extension CL it is clear, that due to a CL visibility principle it allows to see all the classes loaded by parent Bootstrap CL.

Since Java 9 Extension CL has been replaced with Platform CL. And there are two substantial diffs:

  1. Platform CL is not an instance of URLClassLoader
  2. All classes in the Java SE Platform are guaranteed to be visible through the platform class loader. In addition, the classes in modules that are standardized under the Java Community Process but not part of the Java SE Platform are guaranteed to be visible through the platform class loader.

I am confused by the 2nd point. What does it mean "the classes in modules that are standardized under the Java Community Process but not part of the Java SE Platform"?

Dzmitry Alifer
  • 409
  • 1
  • 6
  • 17
  • 3
    The "Run-time Built-in Class Loaders" section in the ClassLoader javadoc is a good reference. For the most part, the platform class loader is the equivalent of what used to known as the extension class loader. One motivation for renaming it is that the extension mechanism has been removed. The section you quote from the Migration Guide is indeed confusing - I will create a bug to get that clarified. The only JCP defined module included in the JDK that isn't defined by Java SE is the java.smartcardio module. – Alan Bateman Apr 07 '19 at 16:06

0 Answers0