concept same module in category java

appears as: same module, same modules
The Java Module System

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

That the JPMS doesn’t “see” versions also means it won’t distinguish two different versions of the same module. On the contrary, and in line with the goal of reliable configuration, it will perceive this situation as a classic ambiguity—the same module present twice—and refuse to compile or launch. For more on module versions, see chapter 13.

Figure 11.15 (Left) How a public type in a non-exported package can be accessed by other types in the same module but not by types from other modules. (Right) A similar situation, but on a higher level, where qualified exports are used to make a package in one module available to a defined set of modules while keeping it inaccessible to unprivileged ones.

c11_15.png

We’ll first discuss in what ways the module system could support versions and why it doesn’t do that (section 13.1). It at least allows you to record and evaluate version information, though, and we’ll explore that next (section 13.2). Last on the list is the Holy Grail: running different versions of the same module (section 13.3). Although there’s no native support for that, there are ways to make it happen with some effort.

By the end of this chapter, you’ll have a clear understanding of the module system’s limited support for versions. This will help you analyze your application and can even be used to proactively report possible problems. Maybe more important, you’ll also know the reasons for the limitations and whether you can expect them to change. You’ll also learn how to run multiple versions of the same module—but as you’ll see, it will rarely be worth the effort.