Why did Java 9 introduce the JMOD file format?

馋奶兔 提交于 2019-12-02 16:37:28

Here are some quotes from JEP 261: Module System, which contains a section on JMOD files.

Why?

From JEP 261:

The new JMOD format goes beyond JAR files to include native code, configuration files, and other kinds of data that do not fit naturally, if at all, into JAR files.

and

The final format of JMOD files is an open issue, but for now it is based on ZIP files.

Should a developer publish JMOD files?

Note that JMOD files appear to be a way to incorporate native code (among other things) at compile-time and link-time. From JEP 261:

JMOD files can be used at compile time and link time, but not at run time.

(To be honest, I'm not sure how native code is published pre-JDK 9.) For the vast majority of developers (without native libraries or other corner-cases), we will merely publish modular jars.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!