Home > Java > javaTutorial > What is the module system in Java 9?

What is the module system in Java 9?

PHPz
Release: 2023-08-19 20:29:07
forward
608 people have browsed it

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.

  • Modular JDK
  • Modular Java source code
  • Modular runtime image
  • Encapsulation of Java internal API
  • Java Platform Module System

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.

Syntax

<strong>module Module-Name {
   requires moduleName;
   exports packageName;
}</strong>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template