Modularity Details

This dialog is deprecated, please use the Module Dependencies tab of the Java Build Path page.

This dialog allows to configure details of a given build path entry - details, which influence how the modules of an application are wired.

Every entry on the Projects and Libraries tabs of the Java Build Path contains a node module properties icon Is modular or module properties icon Is not modular. You can open the dialog for modularity details by selecting this node and pressing Edit... or simply by double-clicking.

At the top of the dialog you will find a check box Defines one or more modules, which toggles whether or not the current build path entry will be interpreted using the rules of the Java Platform Module System (JPMS) or as a pre-Java-9 library. Clicking this checkbox has the same effect as moving the build path entry from Classpath to Modulepath or vice versa.

The options configured via this dialog essentially correspond to the command line options specified by JEP 261, but no claim is made that options in this dialog have the exact same structure as JEP 261 options.

Contents tab

This tab is relevant only if a build path entry contains several modules, as it is the case specifically for the JRE System Library. The purpose of this tab is to select which contained modules should be observable (see JLS §7.7.6) when building the current project.

The upper right part of this tab lists all modules that selected for inclusion. The lower right part lists additional modules that are included because they are required by an included module. The upper left part lists those modules that are available in the current build path entry, but not observable for the current project.

Modules can be moved from one box to another by

If a module is moved from available to explicitly included, any required modules will be moved to implicitly included as needed.

Regarding JEP 261, this tab combines the --limit-modules and the --add-modules options. When the current project is not modular, then the dialog for JRE System Library is pre-filled with the contents corresponding to the "Root modules" as specified in JEP 261.

Details tab

This tab groups additional options that influence the wiring between modules in the build. Throughout this tab, text fields offer content assist (Ctrl+Space).

At the top, a checkbox labeled Patches an existing module allows to define the current project as patching another module on the build path. The effect is that classes in this project will be compiled as part of the module being patched. If the current build path entry defines several modules, the adjacent text field is used to select which module should be patched.

This option corresponds to the --patch-module option from JEP 261.

Below, you will find a list of Added exports. Use the buttons Add..., Edit... and Remove to modify the list. The effect of an entry in this list is, that the given Source module will export the specified Package the the Target module. The module defined by the current project will always be used as the target module, while the source module must be contained in the current build path entry. In other words, by this option the current project acquires access to a not-exported package from another module.

This option corresponds to the --add-exports option from JEP 261.

At the bottom, you see a list of Added read modules. Use the buttons Add..., Edit... and Remove to modify the list. The effect of an entry in this list is the same as if a requires directive would be added to module-info.java of the referenced source module, which must be one of the modules of the current build path entry. In other words: the source module will be made to "read" the target module.

This option corresponds to the --add-reads option from JEP 261.