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
Navigation

With modules defined, compiled, and packaged into modular JARs as explained in chapters 3 and 4, it is finally time to power up the JVM and run applications with the java command (5.1). This gives us the opportunity to discuss a run-time related concept, namely how to load resources from modules (5.2). Sooner or later things will go wrong, though, so we also look into debugging a module configuration with a variety of command line options (5.3).

By the end of the chapter you will be able to launch an application made up of modules. Beyond that you will 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 one 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.

5.1  Launching the JVM with modules

5.1.1  Specifying the main class

5.1.2  Passing parameters to the application

5.2  Loading resources from modules

5.2.1  Resource loading before Java 9

5.2.2  Resource loading on Java 9 and later

5.2.3  Loading package resources across module boundaries

5.3  Debugging modules and modular applications

5.3.1  Analyzing individual modules

5.3.2  Validating sets of modules

sitemap