How do module dependencies and class loading work?
The nuts and bolts of module dependencies are as follows: • Modules can load classes from modules they depend on. They have to declare a dependency on them. • NetBeans does not care about things like the CLASSPATH environment variable – it knows how to find modules in an installation of NetBeans, and enforces dependencies between them. What this means is that if • Module B tries to use a class from module A, but module B does not explicitly state that it depends on A, or… • Module B tries to use a class from module A, and it does declare a dependency on Module A, but the package that class is in is not in the list of packages A says other modules can touch… then a NoClassDefFoundException will be thrown at runtime. (If you even get that far – the module build harness will refuse to even compile module B in such cases.) An exception to the second item is that if Module B declares an implementation dependency on module A, then it will have access to the full set of classes. Normally