Contents of page >
1) Modular JDK in java 9 >
Use Java Platform Module System to modularize the JDK in java 9.
2) What will be there in Modular JDK in java 9 >
JDK will be divided into set of modules that can be combined at >
- compile time,
- build time or
- run time into different configurations.
The modular structure make a clear distinction between standard modules (whose specifications are governed by the Java Community Process) and modules specific to JDK.
It will also distinguish modules that will be included in the Java SE Platform Specification.
3) What's the motivation behind Modular JDK in java 9?
Motivation behind Modular JDK is Jigsaw Project in java 9.
The primary goals of this Jigsaw Project -
- To make JDK and Java SE Platform easily scalable
- To make JDK and Java SE Platform more maintainable.
- To make JDK and Java SE Platform Secure.
- To improve performance of JDK and Java SE Platform.
- To make it easier to add libraries in JDK and Java SE Platform.
4) Modular JDK implements following Design principles in java 9 >
- Standard modules - Names must start with the string "java."
- All other modules (merely part of the JDK) - Names must start with the string "jdk."
- If a module exports a package that contains a public or protected member (that refers to a type from some other module), then the first module must grant implied readability to the second ( via public). (This ensures that method-invocation chaining works fine).
- Standard module may contain both in java 9 >
- standard API and
- non-standard API packages.
- If standard module exports a standard API package then the export may be qualified
- if a standard module exports a non-standard API package then the export must be qualified.
- A standard module may depend upon one or more non-standard modules.
- standard module must NOT grant implied readability to any non-standard module.
- A non-standard module must not export any standard API packages in java 9.
- A non-standard module may grant implied readability to a standard module.
5) Modular JDK as a graph in java 9 >
- Each module is a node,
- There is directed edge from one module to another (if the first depends upon the second)
Diagram : Modular JDK as a graph
Check out full diagram on openjdk.java.net/jdk.png
Let’s understand 10 important components of graph in java 9 >
- Java SE modules - orange colour.
- Non-SE modules - blue colour.
- When edge from the first module to the second is solid ?
- If one module depends upon another (it grants implied readability to that module)
When edge from the first module to the second is dashed?
- If one module depends doesn’t upon another.
- At top is the java.se.ee module (it gathers together all of the modules that comprise the Java SE Platform, including modules that overlap with Java EE Platform Specification)
- At bottom is java.base module which contains classes like >
- java.lang.Object and
- The java.se aggregator module ( it gathers together those parts of the Java SE Platform that do not overlap with Java EE).
- Aggregator modules that implement the Java SE Compact Profiles >
- java.compact2, and
- The other non-standard modules contain >
- Debugging and serviceability tools and APIs like -
- jdk.jcmd and
- Development tools -
- jdk.javadoc and
- Service providers -
- jdk.scripting.nashorn and
- The java.smartcardio module is standard but not part of the Java SE Platform.
6) Dependences of modular JDK in java 9 >
Modular JDK is dependent on following >
In this java tutorial we learned about Modular JDK in java 9.
JDK will be divided into set of modules that can be combined at compile time, build time or run time into different configurations.
The modular structure make a clear distinction between standard modules and modules specific to JDK.
Having any doubt? or you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.