DEV Community

loizenai
loizenai

Posted on

Java 9 Module System

https://grokonez.com/java/java-9/java-9-module-system

Java 9 Module System

Java 9 Module System, which is developed under Project Jigsaw, comes to us with the specific goal: to provide reliable configuration and strong flexible encapsulation. That helps application developers, library developers, or Java SE Platform implementors more easilier create a scalable platform, make greater platform integrity, and improve performance. In this tutorial, we're gonna take a look at Java 9 Module System in a summarized way.

I. Why Jigsaw?

The primary goals of Project Jigsaw are to:

  • Make the Java SE Platform, and the JDK, more easily scalable down to small computing devices;
  • Improve the security and maintainability of Java SE Platform Implementations in general, and the JDK in particular;
  • Enable improved application performance;
  • Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms.

A standard module system was designed and implemented to have ability to modularize the JDK and other large legacy code bases.

II. Module System

1. What is Module?

1.1 Definition

A module is a named, self-describing collection of:

  • code: packages containing types (Java classes, interfaces...)
  • data: resources and other kinds of static information.

In summary:

  • Class contains fields, methods.
  • Package contains Classes, Enums, Interfaces, configuration files...
  • Module contains Package and Other data resources.

    1.2 Declaration

    This is the way we declare a module:

More at:

https://grokonez.com/java/java-9/java-9-module-system

Java 9 Module System

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay