Advance Programming In Java | 13. Java Modules and the JPMS (Java Platform Module System) by Abraham | Learn Smarter
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

13. Java Modules and the JPMS (Java Platform Module System)

13. Java Modules and the JPMS (Java Platform Module System)

Java Modules and the Java Platform Module System (JPMS) enhance modularity, encapsulation, and maintainability in Java applications. Introduced in Java 9, JPMS allows developers to organize code into well-defined modules with controlled dependencies, which helps mitigate issues like JAR conflicts and improves application performance and security. The chapter covers the structure of modules, the module-info.java descriptor, and various directives such as requires and exports, along with the benefits and limitations of the new system.

12 sections

Enroll to start learning

You've not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Sections

Navigate through the learning materials and practice exercises.

  1. 13
    Java Modules And The Jpms (Java Platform Module System)

    This section introduces Java Modules and the Java Platform Module System...

  2. 13.1
    What Is A Module In Java?

    A module in Java is a self-contained unit of code that organizes related...

  3. 13.2
    Why Jpms Was Introduced

    JPMS was introduced in Java 9 to address code packaging issues and improve...

  4. 13.3
    Structure Of A Module

    This section discusses the structure of a module in Java, highlighting the...

  5. 13.4
    Components Of Module System

    This section outlines the key components of the Java Platform Module System...

  6. 13.5
    Types Of Modules

    This section discusses the different types of modules in the Java Platform...

  7. 13.6
    Java Platform Modules

    The Java Platform Modules consist of standard modularized components that...

  8. 13.7
    Creating And Using Modules – Example

    This section demonstrates how to create and utilize Java modules, detailing...

  9. 13.8
    Benefits Of Jpms

    The Java Platform Module System (JPMS) introduces significant benefits...

  10. 13.9
    Limitations And Challenges

    The limitations and challenges of JPMS primarily include the learning curve...

  11. 13.10
    Jpms Vs Osgi

    This section compares the Java Platform Module System (JPMS) with OSGi,...

  12. 13.11
    Migration From Non-Modular To Modular Code

    This section outlines the steps to migrate Java code from a non-modular...

What we have learnt

  • Modules in Java are self-contained units that group packages and resources.
  • JPMS introduces strong encapsulation and reliable configuration to avoid common dependency issues.
  • Creating modules involves defining module-info.java files that specify dependencies and which packages to export.

Key Concepts

-- Module
A self-contained unit of code that groups related packages and specifies which packages to export and which modules to require.
-- moduleinfo.java
A file that acts as a descriptor for Java modules, declaring module dependencies and exports.
-- JPMS
Java Platform Module System, introduced in Java 9 to enhance modularity, security, and maintainability of Java applications.
-- requires Directive
A declaration in module-info.java that specifies dependencies between modules.
-- exports Directive
A declaration that specifies which packages are made accessible to other modules.
-- opens Directive
A declaration to open a package for reflection, allowing access to its members at runtime.

Additional Learning Materials

Supplementary resources to enhance your learning experience.