concept unnamed module in category java

appears as: unnamed module, Unnamed modules, unnamed module, The unnamed module, The unnamed module, unnamed modules, n unnamed module
The Java Module System

This is an excerpt from Manning's book The Java Module System.

  • Unnamed modules —Modules that aren’t named (spoiler: class path content) and hence aren’t explicit.
  • > recording unnamed module for boot loader
    > java.base location: jrt:/java.base
    > Definition of module: java.base

    But how do you decide where code needs to go? As a general guideline, the unnamed module is about compatibility, enabling projects using the class path to work on Java 9+; whereas automatic modules are about modularization, allowing projects to use the module system even if dependencies aren’t yet modularized.

    Figure 8.2 Launched with all application JARs on the class path, the module system builds a module graph from the platform modules (left) and assigns all classes on the class path to the unnamed module (right), which can read all other modules

    c08_02.png

    Armed with that understanding, you’re well prepared to run simple, mon-modular applications from the class path. Beyond that basic use case, and particularly when slowly modularizing an application, the subtleties of the unnamed module become relevant, so we look at them next.