Compose Java services with the module system
8 steps · about 2 h 36 min · Intermediate
- Understand what a named module changes (tutorial, Dev.java, 24 min)
The official tutorial frames readability, exports and strong encapsulation before code is split.
- Inspect modules at runtime (reference, Oracle Java documentation, 14 min)
The Module API makes the resolved runtime model concrete and inspectable.
- Compile a multi-module source tree (guide, Oracle Java documentation, 22 min)
The compiler's module-source-path rules determine whether the source layout is reproducible.
- Inspect the module artifact format (guide, Oracle Java documentation, 16 min)
The jmod tool makes the contents and boundaries of a platform module artifact concrete.
- Define and discover a service provider (reference, Oracle Java documentation, 22 min)
ServiceLoader connects an interface to implementations without exporting their internals.
- Audit dependencies and accidental internals (guide, Oracle Java documentation, 18 min)
jdeps reveals missing module declarations and reliance on unsupported JDK internals.
- Package modular JAR files (guide, Oracle Java documentation, 16 min)
A deliberate archive layout preserves descriptors and gives each module a stable artifact.
- Build and verify a custom runtime (guide, Oracle Java documentation, 24 min)
jlink is the final proof that the resolved module graph contains everything the application needs.