Home >Java >javaTutorial >What is the module system in Java 9?
One of the big changes in Java 9 features is ModulesSystem. Java 9 introduced the following features as part of the Jigsaw project.
One of the main motivations for using modulesSystem is to provide modularity for running on devices with less available memory JVM. The JVM runs only the modules and APIs required by the application.
<strong>module Module-Name { requires moduleName; exports packageName; }</strong>
Modular JAR files contain an additional module descriptor. In this module descriptor, the dependencies of other modules are expressed through the "requires" statement. The "exports" statement controls which packages can access other modules.
The above is the detailed content of What is the module system in Java 9?. For more information, please follow other related articles on the PHP Chinese website!