Include exports in the module-info.java file of a module:
module |
The exports keyword enables a package from a module to be accessible by other modules.
By adding the to keyword, the exported package can be restricted to usage only by the specified modules.
Note: The exports keyword is a module directive intended to be used in a module’s module-info.java file.
The exports keyword was introduced in Java 9.