I use OSGI and this is the main reason that I want to disable modules, as I really don't need another module framework. Is it possible to do it, for example using command line option? If yes, then how?
Q 7 - Which of the following is correct about Module System in Java 9? A - javac, jlink, and java have additional options to specify module paths, which further locate definitions of modules.
No. There is no need to switch to modules. There has never been a need to switch to modules. Java 9 and later releases support traditional JAR files on the traditional class path, via the concept of the unnamed module, and will likely do so until the heat death of the universe.
It is a set of related Packages, Types (classes, abstract classes, interfaces etc) with Code & Data and Resources. Each Module contains only a set of related code and data to support Single Responsibility (Functionality) Principle (SRP). The main goal of Java 9 Module System is to support Modular Programming in Java.
Software developers can decompose a monolithic Java application into many single-purpose modules. Properly architected applications using SOLID principles and modules can yield applications that are easier to maintain than if the application were a monolith, which again saves money.
There is no option to turn off the module system - it will always be active. This impacts access to JDK-internal APIs, dependencies on Java EE modules, Split packages, and a lot of other small details. Your code and your dependencies have to deal with those migration challenges if you want your application to run on Java 9.
You are by no means forced to create modules, though. You can completely ignore module-info.java
and continue to place all your JARs onto the class path. The module system will silently bundle them all into the unnamed module, which was created for maximum compatibility. You won't even notice the module system is there (assuming you've overcome the challenges I described earlier).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With