Create your own VM using Java Modules
Over this article lets explore the concept of Java Modules practically. Finally, let's create a small application by using java modules and its VM.
Java modules is one of the great feature introduced as part of Java 9. It improves your code with more strong encapsulation, It is able to reduce the size of the VM, improves the execution time, and so on.
Let's get into depth about the coding of java modules.
Java Module Project Structure
First, let's see how a java module project looks like. The details about java modules are configured on a file called module-info.java which is coming under the root folder. Inside of the file, it is specifying what are the dependent modules, what are the services which it offers, services which it consumes …etc.
The module-info.java file extension is java but it is not a class file or interface file. It is used for defining modules. The structure of the module-info.java file follows.
module lici.modules.gui {
}
In the above, it shows a simple module-info.java file structure. Here, it is defined as the module lici.modules.gui. It is able to add the additional dependent module directives inside the curly braces.