This is a continuation of the module system introduced to Java 9 . You can find Part — I at the link below:

Nuances

The module system comes with its on set of rules on how it can be accessed. The module should be allowed to access the other module via the requires keyword. The other module should export the package and the type itself should be public (to make it visible)

The module system also requires that two modules cannot have the same package name. This enforcement separates the module-path from the class-path paradigm where packages could be overridden by multiple jars having same package name. …


Java 9 as we all know introduced the Java Platform Module System (JSR 376). This addresses some of the issues of the existing Java ecosystem.

The three main issues from a development point of view that the module system in Java 9 tries to address:

  1. Hiding implementation
  2. Effectively removing dependency on legacy code for a library
  3. Sanitizing the Classpath

Advantages of JPMS

  1. Scalable Platform
  2. Security & maintainability
  3. Improved application performance
  4. Easier developer experience

So then how does the module system promise all this? To answer the question we should first understand Java’s module system.

Sins of the CLASSPATH

A traditional java application involves building libraries into jars and placing them on the class-path of the run-time. The run-time resolves the dependencies for the types using the the package name. Once in the class-path, the JVM treats classes in a JAR no differently from separate class files all in the same root directory. At run-time, as far as the JVM is concerned, an application is just a set of classes in a flat list of packages. …

Jubin Kuriakose

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store