91年的羊是什么命| 茧子是什么意思| 人活着到底是为了什么| 不明觉厉是什么意思| 公积金有什么作用| 超七水晶是什么| 痛风不能吃什么蔬菜| 胚由什么组成| 抬举是什么意思| 脚底麻是什么原因| 为什么总长火疖子| 肛瘘是什么原因引起的| 吃什么瘦肚子脂肪最快| 久卧伤什么| 蠓虫叮咬后涂什么药膏| 口什么心什么| 林黛玉是什么病| 鸭子烧什么配菜好吃| 云为什么不会掉下来| 骨关节疼痛什么原因| 火龙果和香蕉榨汁有什么功效| 尿糖1十是什么意思| 钩针ch是什么意思| 凌晨三点是什么时辰| 3月7日什么星座| 什么是子宫憩室| 例假来的是黑色的是什么原因| 湿疹用什么药最好| 4月19是什么星座| 什么东西能戒酒| 牛奶加咖啡叫什么| sg比重是什么意思| 慈母手中线的下一句是什么| 窦性心动过速吃什么药| 开塞露是什么成分| 荨麻疹吃什么药好得快| 淳朴是什么意思| 鼻涕倒流吃什么药| 此地无银三百两什么意思| 银手镯发黄是什么原因| 副高是什么职称| 养尊处优是什么意思| 子宫肌瘤变性是什么意思| 脚老抽筋是什么原因| 绿色食品指什么食品| 女人梦见烧纸什么预兆| 什么血型会导致不孕| 什么也别说| 心电图低电压什么意思| 籺是什么意思| 吃什么补钾最快最好| 石蜡是什么东西| 一什么正什么| 动脉硬化是什么症状| 血常规能查出什么| 阴茎里面痒是什么原因| 新疆人是什么民族| 歆字取名什么寓意| 人参果吃了有什么好处| 益生菌适合什么人群吃| 孕妇过敏性鼻炎可以用什么药| gap是什么品牌| 王大治与董洁什么关系| 银行支行行长什么级别| 铅笔为什么叫铅笔| 乐得什么填词语| 手口足吃什么药| 什么是毒龙| 热痱子是什么样子图片| 伤口拆线挂什么科| 乌冬是什么| o和b型生的孩子是什么血型| 龙的三合生肖是什么| 虎毒不食子什么意思| 端倪是什么意思| 有个马的标志是什么车| poems综合征是什么病| 为什么会这样| 女性得乙肝有什么症状| 伤官运是什么意思| epa是什么营养物质| 手球是什么运动| 肛门潮湿是什么情况| 人流复查做什么检查| 跳蚤怕什么| 黄皮不能和什么一起吃| 长脸适合什么眼镜框| 铜罗是什么生肖| 明月几时有的下一句是什么| 曲苑杂坛为什么停播| 梦见大火烧房子是什么意思| 公关是什么意思| original是什么牌子| 四大天王叫什么名字| 馥字五行属什么| 抽烟对身体有什么危害| 什么东西解辣| 东南方是什么生肖| 无创是什么意思| 偏头疼吃什么药效果好| 手掌心发红是什么原因| 肠道有息肉有什么症状| lv是什么| 申字五行属什么| 未央什么意思| 大姨妈有黑色血块是什么原因| 跻身是什么意思| 睡觉憋气是什么原因引起的| 大腿疼是什么原因| 料酒可以用什么代替| 微信什么时候有的| 皮粉色是什么颜色| 体外射精什么意思| 血小板低会出现什么症状| 牙酸是什么原因| 奡是什么意思| af是什么| 傻子是什么意思| ipa啤酒什么意思| 汗腺是什么| 咳嗽一直不好是什么原因怎么治| 六十而耳顺是什么意思| 身上湿气重吃什么药| 金卡有什么好处和坏处| 白细胞2个加号是什么意思| 电是什么| 罘是什么意思| 92年1月属什么生肖| 同房后小腹痛什么原因| 已所不欲勿施于人是什么意思| 吃什么清理血管| 吃晕车药有什么副作用| 乡长是什么级别| 办身份证要带什么| 亭台楼阁是什么意思| 彩超检查什么| 夏天手脱皮是什么原因| 就是什么意思| 脂溢性脱发是什么意思| 手心脱皮是什么原因| 畏光是什么意思| 豆芽不能和什么一起吃| 性质是什么| 口水臭是什么原因| 科目一考试需要带什么| 凝血五项是检查什么病| 五体投地是什么意思| 器质性疾病是什么意思| 现在当兵需要什么条件| 换床有什么讲究| 免贵姓是什么意思| 互诉衷肠是什么意思| 四叶草代表什么意思| 西咪替丁是什么药| 什么是便血| 风是什么结构| 梦见自己结婚了是什么意思| 小便有点黄是什么原因| lmp医学上什么意思| 屁的成分是什么气体| 痛经吃什么止疼药| 不显怀的人有什么特点| 为什么说尽量不戴脚链| 今年温度为什么这么高| 儿童腮腺炎挂什么科| 脂溢性脱发是什么原因引起的| 土星为什么有光环| 胆囊炎的症状是什么| 10月15号是什么星座| 笔什么龙什么| 男马配什么属相最好| 胆囊大是什么原因| 经常晕倒是什么原因引起的| 93年是什么命| 露怯是什么意思| 封神榜讲的是什么故事| 脸颊两边长痘痘是什么原因引起的| 乌龟吃什么食物| 青筋明显是什么原因| ca153是什么检查项目| 早上左眼跳是什么预兆| 尿路感染吃什么药比较好的快| 酥油茶是什么做的| 4岁打什么疫苗| ct检查什么| 2岁打什么疫苗| calcium是什么意思| 嘴唇上长疱疹用什么药| 阴道口出血是什么原因| 看牙挂什么科| 骨蒸潮热是什么意思| 嗓子哑了是什么原因| 农历2月份是什么星座| 一声什么| 中暑什么症状表现| 威士忌是什么酿造的| 商品下架是什么意思| 胃立康片适合什么病| 前列腺炎挂什么科| 为什么一紧张就拉肚子| 什么是肛裂| 右侧卵巢无回声是什么意思| 68年属什么| 慢性咽炎吃什么药好| 乙肝表面抗原大于250是什么意思| 吃飞醋是什么意思| 铿锵玫瑰是什么意思| 88年属龙的是什么命| 鳞状上皮内高度病变是什么意思| 孕期什么时候补充dha| 睾丸炎吃什么药好得快| poscer是什么牌子手表| 三个鬼是什么字| 吃什么降胆固醇最快| 槟榔是什么味道| 唾液粘稠是什么原因| 大同有什么好玩的地方| 微调是什么意思| cg是什么意思| 肾囊肿有什么症状表现| 类固醇是什么东西| 头皮特别痒是什么原因| 桥本甲状腺炎挂什么科| 32岁属什么的生肖| 四月九号是什么星座| 回是什么生肖| 什么东西泡水喝降血压| 早泄吃什么药最好| 六味地黄丸有什么功效| 舞蹈考级有什么用| 梦见绿豆是什么意思| 蜈蚣吃什么| 扁桃体结石是什么原因引起的| 早熟是什么意思| bella是什么意思| 消失是什么意思| 松子吃了有什么好处和坏处| 心肾不交吃什么药| 梦见葱是什么意思| 犒劳自己是什么意思| 什么人不能吃香蕉| palladium是什么牌子| 腿疼吃什么药| 什么冰淇淋最贵| 闰六月是什么意思| 异食癖是什么意思| 什么牛什么毛| 摸胸是什么感觉| 宫腔积液排出什么颜色| 肠化生是什么意思| 小孩流鼻血挂什么科| amy什么意思| 骨裂是什么感觉| 吃什么可以偷偷流产| 办理出院手续都需要什么| 什么的琴声| 探病买什么水果| 女性掉发严重是什么原因| 什么叫代孕| 社保跟医保有什么区别| 肺部磨玻璃结节需要注意什么| 心慌什么原因引起的| 便秘吃什么最快排便| 多梦睡眠质量不好是什么原因| 百度

建湖县委书记肯定县法院家事审判改革试点工作

(Redirected from Java Module System)
百度 国家新闻出版广电总局监管中心发布的《网络原创节目发展分析报告》(网络综艺篇)显示,2017年度共上线网络综艺节目197档(较2016年度同比增长%),播放量总计552亿次(较2016年同比增长120%);《奇葩说》《火星情报局》《明星大侦探》等老牌网综热度不减,《中国有嘻哈》《明日之子》《吐槽大会》等初代网综再创新高;腾讯视频、优酷、爱奇艺、芒果TV作为第一梯队的平台格局日益稳固。

The Java Platform Module System[1] specifies a distribution format for collections of Java code and associated resources. It also specifies a repository for storing these collections, or modules, and identifies how they can be discovered, loaded and checked for integrity. It includes features such as namespaces with the aim of fixing some of the shortcomings in the existing JAR format, especially the JAR Hell, which can lead to issues such as classpath and class loading problems.

The Java Module System was initially being developed under the Java Community Process as JSR 277 and was scheduled to be released with Java 7.

JSR 277 later was put on hold and Project Jigsaw[2] was created to modularize the JDK. This JSR was superseded by JSR 376 (Java Platform Module System).

Project Jigsaw was originally intended for Java 7 (2011) but was deferred to Java 8 (2014) as part of Plan B,[3] and again deferred to a Java 9 release in 2017.[4] Java 9 including the Java Module System was released on September 21, 2017.[5]

Architecture

edit

The Java Module System implemented in Java 9 includes the following JEPs and JSR (Java Specification Request):[2]

  • JEP 200: The Modular JDK: Define a modular structure for the JDK
  • JEP 201: Modular Source Code: Reorganize the JDK source code into modules, enhance the build system to compile modules, and enforce module boundaries at build time
  • JEP 220: Modular Run-Time Images: Restructure the JDK and JRE run-time images to accommodate modules and to improve performance, security, and maintainability
  • JEP 261: Module System: Implement the Java Platform Module System
  • JEP 282: The Java Linker: Create a tool that can assemble and optimize a set of modules and their dependencies into a custom run-time image[6]
  • JSR 376: Java Platform Module System[7]

Additionally, several other JDK 9 features have been added to ease transition to the module system:

  • JEP 238: Multi-Release JAR Files: Extend the JAR file format to allow multiple, Java-release-specific versions of class files to coexist in a single archive.[8]
  • JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization: Define public APIs for the JavaFX functionalities that is presently only available via internal APIs and would become inaccessible due to modularization.[9]
  • JEP 260: Encapsulate Most Internal APIs: Make most of the JDK's internal APIs inaccessible by default but leave a few critical, widely-used internal APIs accessible, until supported replacements exist for all or most of their functionality.[10]
  • JEP 275: Modular Java Application Packaging: The Java packager will evolve for JDK 9, making it aware of modules, allowing for example to package a module and all the modules it depends on.[11]

Properties of modules

edit

Modules are a new way of grouping code. Contrary to Jar files, modules explicitly declare which modules they depend on, and what packages they export.[12] Explicit dependency declarations improve the integrity of the code, by making it easier to reason about large applications and the dependencies between software components.

The module declaration is placed in a file named module-info.java at the root of the module’s source-file hierarchy. The JDK will verify dependencies and interactions between modules both at compile-time and runtime.

For example, the following module declaration declares that the module com.foo.bar depends on another com.foo.baz module, and exports the following packages: com.foo.bar.alpha and com.foo.bar.beta:

module com.foo.bar {
    requires com.foo.baz;

    exports com.foo.bar.alpha;
    exports com.foo.bar.beta;
}

The public members of com.foo.bar.alpha and com.foo.bar.beta packages will be accessible by dependent modules. Private members are inaccessible even through a means such as reflection. Note that in Java versions 9 through 16, whether such 'illegal access' is de facto permitted depends on a command line setting.[13]

The JDK itself has been modularized in Java 9.[14] For example, the majority of the Java standard library is exported by the module java.base.

As of Java 25, modules can themselves be imported, automatically importing all exported packages.[15] This is done using import module. For example, import module java.sql; is equivalent to

import java.sql.*;
import javax.sql.*;
// Remaining indirect exports from java.logging, java.transaction.xa, and java.xml

Similarly, import module java.base;, similarly, imports all 54 packages belonging to java.base.

import module java.base;

/**
 * importing module java.base allows us to avoid manually importing most classes
 * the following classes (outside of java.lang) are used:
 * java.text.MessageFormat
 * java.util.Date
 * java.util.List
 * java.util.concurrent.ThreadLocalRandom
 */
public class Example {
    public static void main(String[] args) {
        List<String> colours = List.of("Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet");
        IO.println(MessageFormat.format("My favourite colour is {0} and today is {1,date,long}",
            colours.get(ThreadLocalRandom.current().nextInt(colours.size())),
            new Date()
        ));
    }
}

Modules use the following keywords:

  • exports: used in a module declaration to specify which packages are available to other modules
  • module: declares a module
  • open: indicates that all classes in a package are accessible via reflection by other modules
  • opens: used to open a specific package for reflection to other modules
  • provides: used to declare that a module provides an implementation of a service interface
  • requires: used in a module declaration to specify that the module depends on another module
  • to: used with the opens directive to specify which module is allowed to reflectively access the package
  • transitive: used with the requires directive to indicate that a module not only requires another module but also makes that module's dependencies available to modules that depend on it
  • uses: used in a module to declare that the module is using a service (i.e. it will consume a service provided by other modules)
  • with: used with the provides directive to specify which implementation of a service is provided by the module

Core modules

edit

The modules under namespace java.* belong to the Java Platform, Standard Edition, and modules under namespace jdk.* belong to the Java Development Kit.[16]

java.base Defines the core APIs that form the foundation of the Java SE Platform.

Implicitly required by all modules and does not need to be declared with requires inside a module declaration.

java.compiler Defines APIs related to the language model, Java annotation processing, and the Java compiler.
java.datatransfer Defines the APIs that facilitate data transfer between applications or within an application.
java.desktop Defines the Abstract Window Toolkit (AWT) and Swing libraries for user interfaces, along with APIs for accessibility, audio, imaging, printing, and JavaBeans.
java.instrument Defines services that allow for the instrumentation of programs running on the Java Virtual Machine (JVM).
java.logging Defines the API for logging events in Java applications (Java Logging API).
java.management Defines the APIs for the Java Management Extensions (JMX) framework.
java.management.rmi Defines the Remote Method Invocation (RMI) connector for the Java Management Extensions (JMX) Remote API.
java.naming Defines the API for Java Naming and Directory Interface (JNDI) services.
java.net.http Defines the API for HTTP client and WebSocket functionality.
java.prefs Defines the API for managing and storing user preferences.
java.rmi Defines the Remote Method Invocation (RMI) API for object communication across Java virtual machines.
java.scripting Defines the API for integrating scripting engines into Java applications (Scripting API).
java.se Defines the standard API for the Java SE Platform.
java.security.jgss Defines the Java binding for the IETF Generic Security Services API (GSS-API) for security contexts.
java.security.sasl Defines Java's support for the Simple Authentication and Security Layer (SASL) protocol.
java.smartcardio Defines the API for interacting with smart card devices (Java Smart Card I/O API).
java.sql Defines the Java Database Connectivity (JDBC) API for database interaction.
java.sql.rowset Defines the JDBC RowSet API for managing and interacting with tabular data in Java.
java.transaction.xa Defines an API for managing distributed transactions within JDBC.
java.xml Defines the Java API for XML Processing (JAXP), including tools for parsing and transforming XML data.
java.xml.crypto Defines the API for cryptographic operations with XML data.
jdk.accessibility Defines utility classes for implementing Assistive Technologies in the JDK.
jdk.attach Defines the attach API for connecting to and interacting with a running JVM instance (attach API).
jdk.charsets Provides additional character sets (charsets), including double-byte and IBM-specific charsets, not included in java.base.
jdk.compiler Defines the internal implementation of the Java compiler and the command-line tool javac.
jdk.crypto.cryptoki Defines the implementation of the SunPKCS11 security provider for cryptographic operations.
jdk.dynalink Defines the API for dynamically linking high-level operations on objects.
jdk.editpad Implements the edit pad service used by jdk.jshell for evaluating code.
jdk.hotspot.agent Provides the implementation for the HotSpot Serviceability Agent.
jdk.httperver Defines the JDK-specific HTTP server API and the jwebserver tool for running a simple HTTP server.
jdk.incubator.vector Defines the API for expressing computations that can be compiled into SIMD instructions at runtime, such as AVX or NEON instructions.
jdk.jartool Provides tools for manipulating Java Archive (JAR) files, such as the jar and jarsigner commands.
jdk.javadoc Defines the system documentation tool implementation and its command-line version, javadoc.
jdk.jcmd Defines tools for diagnosing and troubleshooting JVM processes, including jcmd, jps, and jstat.
jdk.jconsole Defines the JMX-based graphical tool, jconsole, for monitoring and managing Java applications.
jdk.jdeps Defines tools for analysing dependencies in Java programs and libraries, such as jdeps, javap, jdeprscan, and jnativescan.
jdk.jdi Defines the Java Debug Interface (JDI) for debugging Java applications.
jdk.jdwp.agent Provides the implementation of the Java Debug Wire Protocol (JDWP) agent for remote debugging.
jdk.jfr Defines the API for JDK Flight Recorder (JFR) for collecting performance and diagnostic data.
jdk.jlink Defines the jlink tool for creating custom runtime images, and jmod and jimage tools for managing JMOD and JDK container files.
jdk.jpackage Defines the Java packager tool (jpackage) for creating platform-specific application packages.
jdk.jshell Provides the jshell tool for interactively evaluating Java code snippets.
jdk.jsobject Defines the API for integrating JavaScript objects in Java applications.
jdk.jstatd Defines the jstatd tool for remotely monitoring JVM statistics.
jdk.localedata Provides locale-specific data for non-US locales.
jdk.management Defines JDK-specific management interfaces for JVM monitoring and control.
jdk.management.agent Defines the JMX-based management agent for the JVM.
jdk.management.jfr Defines the management interface for JDK Flight Recorder (JFR).
jdk.naming.dns Implements the DNS Java Naming provider for resolving domain names.
jdk.naming.rmi Implements the RMI Java Naming provider for remote method invocation.
jdk.net Defines the JDK-specific API for network programming.
jdk.nio.mapmode Defines specific file mapping modes available in the JDK.
jdk.sctp Provides the API for Stream Control Transmission Protocol (SCTP) in the JDK.
jdk.security.auth Implements authentication modules and security-related interfaces within the javax.security.auth package (interfaces in javax.security.auth.*).
jdk.security.jgss Defines extensions to the GSS-API and the implementation of the SASL GSSAPI mechanism in the JDK.
jdk.xml.dom Defines the JDK's subset of the World Wide Web Consortium (W3C) Document Object Model (DOM) API not covered by Java SE.
jdk.zipfs Provides the implementation for the ZIP file system provider, enabling access to ZIP files as file systems.
edit

The Java Module System does not intend to support all the functionalities that the OSGi platform currently supports (for example the Life-Cycle model and the Services Registry). However the Java Module System will support functions which are not supported by OSGi, such as modularity at compile-time, and built-in support for native libraries.[17] A couple of articles exploring how the Java Module System and OSGi could interoperate were published in 2016. These can be found on InfoQ[18] and also the OSGi Alliance Blog.[19]

See also

edit

References

edit
  1. ^ "Java Platform Module System (JSR 376)". Oracle Corporation. Retrieved 2025-08-07.
  2. ^ a b "Project Jigsaw". Oracle Corporation. Retrieved 2025-08-07.
  3. ^ Mark Reinhold (2025-08-07). "It's time for … Plan B". Oracle Corporation. Retrieved 2025-08-07.
  4. ^ "JDK 9". Oracle Corporation. Retrieved 2025-08-07.
  5. ^ "Java 9: Release date and new features". techworld.com. 2025-08-07. Retrieved 2025-08-07.
  6. ^ "jlink: The Java Linker (JSR 282)". Oracle Corporation. Retrieved 2025-08-07.
  7. ^ "Java Platform Module System (JSR 376)". Oracle Corporation. Retrieved 2025-08-07.
  8. ^ "JEP 238: Multi-Release JAR Files". Oracle Corporation. Retrieved 2025-08-07.
  9. ^ "JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization". Oracle Corporation. Retrieved 2025-08-07.
  10. ^ "JEP 260: Encapsulate Most Internal APIs". Oracle Corporation. Retrieved 2025-08-07.
  11. ^ "JEP 275: Modular Java Application Packaging". Oracle Corporation. Retrieved 2025-08-07.
  12. ^ Mark Reinhold (2025-08-07). "The State of the Module System". Oracle Corporation. Retrieved 2025-08-07.
  13. ^ "JEP 396: Strongly Encapsulate JDK Internals by Default". Retrieved 2025-08-07.
  14. ^ "JDK Module Summary". Oracle Corporation. 2025-08-07. Archived from the original on 2025-08-07. Retrieved 2025-08-07.
  15. ^ "JEP 494: Module Import Declarations (Second Preview)". openjdk.org.
  16. ^ "Java? Platform, Standard Edition & Java Development Kit Version 24 API Specification". docs.oracle.com.
  17. ^ Mark Reinhold (2025-08-07). "Project Jigsaw: Late for the train: The Q&A". Oracle Corporation. Retrieved 2025-08-07.
  18. ^ "Java 9, OSGi and the Future of Modularity". InfoQ. Retrieved 2025-08-07.
  19. ^ "Java Module Layers and OSGi Bundles". OSGi Alliance. Retrieved 2025-08-07.
edit
落子无悔是什么意思 纪年是什么意思 大学硕士点是什么意思 dm代表什么 凝血功能差是什么原因
可乐鸡翅用什么可乐 怀孕3天有什么症状 孩子注意力不集中去医院看什么科 阿奇霉素主治什么 狗狗的鼻子为什么是湿的
人渣是什么意思 什么是黑天鹅事件 揩是什么意思 明天是什么 ppa是什么药
孕妇喝椰子水有什么好处 三十六计最后一计是什么 偷窥什么意思 英纳格手表什么档次 男性性功能障碍吃什么药
4月1日什么星座hcv8jop6ns4r.cn 吃黄瓜有什么好处和坏处hcv8jop1ns6r.cn 老人助听器什么牌子好hcv8jop0ns3r.cn 眼睛痒用什么眼药水好hcv9jop5ns7r.cn 牙龈起泡是什么原因travellingsim.com
儿童咽峡炎吃什么药hcv8jop8ns0r.cn 美容行业五行属什么huizhijixie.com 什么是粳米hcv9jop4ns0r.cn 尿道感染用什么药hcv9jop0ns2r.cn 风湿性关节炎挂什么科hcv9jop6ns3r.cn
什么可以消肿快的方法xscnpatent.com essence什么意思hcv8jop4ns7r.cn 难过美人关是什么生肖hcv8jop7ns9r.cn 本命年犯太岁什么意思hcv8jop5ns1r.cn 宝宝缺锌有什么表现和症状hcv9jop1ns2r.cn
赤色是什么颜色hcv9jop3ns2r.cn 静脉曲张挂什么科hcv9jop3ns7r.cn 祛斑什么季节做最好hcv9jop2ns1r.cn 毛尖属于什么茶hcv8jop2ns8r.cn 什么水果清热解毒去火0735v.com
百度