Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do module dependencies and class loading work?

0
Posted

How do module dependencies and class loading work?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123