Skip to main content

Posts

Showing posts with the label Project Jigsaw

Java 9 : How to create and run a custom Module

What is a Module in Java 9 ? Java Modules are a part of Project Jigsaw . A module is a named, self-describing collection of code and data . Its code is organized as a set of packages containing types, i.e., Java classes and interfaces; its data includes resources and other kinds of static information. What are the Type of Modules in Java 9 ? There are two types of Java Modules Java Standard Modules , they start with string java. Java Non-Standard Modules , they start with string jdk. Creating a Custom Module. We can make the following types of modules Module that is independent of all other modules. Module that requires other modules as dependencies. Module that exports itself for use by other packages. Module that imports some modules and exports some packages for other modules to use. Note When we are exporting the packages in modules, only the publically expoted modules are available to use by other modules.(We will get to this later in the post.) A simple module that does not impo...

Java 9 : What is Project Jigsaw ?

Project Jigsaw : Points to Remember It is introducded in Java 9. Its main aim is to modularize the Java SE Platform. This will modularize the JDK, and we can use only those modules that we need instead of the full JDK installation. Scale platform to run on smaller applications and devices. Also Read Creating Custom Java Modules Design Implementations of Project Jigsaw. New java commands related to Project Jigsaw added are the following --module-path <module path>... A : separated list of directories, each directory is a directory of modules. --upgrade-module-path <module path>... A : separated list of directories, each directory is a directory of modules that replace upgradeable modules in the runtime image -m <module>[/<mainclass>] --module <modulename>[/<mainclass>] the initial module to resolve, and the name of the main cla...