Why it matters

Modules enable large codebase organization. Understanding matters for library design and JDK internals.

Advertisement

The architecture

module-info.java: declares module name, requires, exports, opens.

Automatic modules: non-modular JARs become modules with name from filename.

JPMS structuremodule-infodeclarationsexportspublic API packagesrequiresdependenciesEncapsulation stronger than package-private; enforced by JVM
Module system.
Advertisement

How it works end to end

exports: package visible to all modules.

exports X to Y: package visible only to specific module.

opens: allow reflection at runtime (frameworks).

services: ServiceLoader integration for pluggable implementations.