5 Running and debugging modular applications
This chapter covers
- Launching a modular application by specifying an initial module
- Loading resources from modules
- Validating modules, sets of modules, and module graphs
- Reducing and listing the universe of observable modules
- Debugging a modular application with logging
With modules defined, compiled, and packaged into modular JARs as explained in chapters 3 and 4, it’s finally time to power up the JVM and run applications with the java command. This gives us the opportunity to discuss a runtime-related concept: how to load resources from modules (section 5.2). Sooner or later things will go wrong, though, so in section 5.3 we also look into debugging a module configuration with a variety of command-line options.
By the end of the chapter, you’ll be able to launch an application made up of modules. Beyond that, you’ll have a firm understanding of how the module system processes a given configuration and how that can be observed through logging and other diagnostic tools.
This also finishes part 1 of the book, which teaches everything you need to know to write, compile, and run simple modular applications. It lays the groundwork for the more advanced features that parts 2 and 3 are going to look into, chief among them those that support a gradual migration to the module system.