Named Module
A named module in the Java Module System is a module that possesses a specific name. This name can be defined in two ways:
-
Explicit Modules: These are modules that include a module descriptor, typically a
module-info.javafile, which explicitly defines the module's name and other module-related information. -
Automatic Modules: These modules do not have a module descriptor. Instead, their names are inferred by the Java Platform Module System (JPMS) based on the JAR file name.
Named modules are an integral part of the module system as they are placed on the module path, which is a sequence of directories and JAR files that the Java runtime uses to locate modules. Once on the module path, named modules can be referenced in module declarations, allowing for clear dependencies and encapsulation within the Java application.
FAQ (Frequently asked questions)
What are named modules in the Java Module System?
How is the name of a named module determined?
What is a named module?
Where are named modules placed in the Java Module System?