JMOD is a Java packaging format introduced with the Java Platform Module System (JPMS) in Java 9. Unlike JAR files, JMOD files are designed for compile and link time only — they cannot be placed on the classpath at runtime. They support native libraries, configuration files, and legal notices in addition to compiled classes. A practical walkthrough shows how to create a modular Java application, package it as a JMOD file using the `jmod create` command, and then use `jlink` to produce a custom minimal Java runtime image (~35 MB vs 400+ MB for a full JDK) containing only the required modules.

6m read timeFrom feeds.feedblitz.com
Post cover image
Table of contents
1. Overview2. What’s JMOD?3. Practical Example: Creating a Custom JRE4. Conclusion
2 Comments

Sort: