The --add-opens option

You can use the --add-opens runtime option to allow your code to access non-public members. This can be referred to as deep reflection. Libraries that do this deep reflection are able to access all members, private and public. To grant this type of access to your code, you use the --add-opens option. Here is the syntax:

    --add-opens module/package=target-module(,target-module)*

This allows the given module to open the specified package. The compiler will not produce any errors or warnings when this is used.

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.