首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁Java:Module”︁的源代码
←
Java:Module
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
Java Platform Module System (JPMS)是Java9中的最大的变动,在[https://jcp.org/en/jsr/detail?id=376|JSR 376: JavaTM Platform Module System]中引入。 = 基本原理 = 首先,模块化的jar文件(Modular JAR)中需要一个<syntaxhighlight lang="java" inline>module-info.class</syntaxhighlight>文件,这个文件里面存储了模块的信息。倘若没有,那么认为这是一个<syntaxhighlight lang="java" inline>automatic module</syntaxhighlight>,也即用jar的文件名作为模块来导出。 除此之外,jar文件中通过<span class="article-label">META-INF</span>目录存储安全、版本等其他信息 * MANIFEST.MF:定义package相关信息 * INDEX.LIST:This file is generated by the new "-i" option of the jar tool, which contains location information for packages defined in an application. It is part of the JarIndex implementation and used by class loaders to speed up their class loading process. * The signature file for the JAR file. 'x' stands for the base file name. * x.DSA:The signature block file associated with the signature file with the same base file name. This file stores the digital signature of the corresponding signature file. * services/:This directory stores all the service provider configuration files. = JDK模块 = <pre> ❯❯❯ java --list-modules java.base@11.0.9 java.compiler@11.0.9 java.datatransfer@11.0.9 java.desktop@11.0.9 java.instrument@11.0.9 java.logging@11.0.9 java.management@11.0.9 java.management.rmi@11.0.9 java.naming@11.0.9 java.net.http@11.0.9 java.prefs@11.0.9 java.rmi@11.0.9 java.scripting@11.0.9 java.se@11.0.9 java.security.jgss@11.0.9 java.security.sasl@11.0.9 java.smartcardio@11.0.9 java.sql@11.0.9 java.sql.rowset@11.0.9 java.transaction.xa@11.0.9 java.xml@11.0.9 java.xml.crypto@11.0.9 jdk.accessibility@11.0.9 jdk.aot@11.0.9 jdk.attach@11.0.9 jdk.charsets@11.0.9 jdk.compiler@11.0.9 jdk.crypto.cryptoki@11.0.9 jdk.crypto.ec@11.0.9 jdk.dynalink@11.0.9 jdk.editpad@11.0.9 jdk.hotspot.agent@11.0.9 jdk.httpserver@11.0.9 jdk.internal.ed@11.0.9 jdk.internal.jvmstat@11.0.9 jdk.internal.le@11.0.9 jdk.internal.opt@11.0.9 jdk.internal.vm.ci@11.0.9 jdk.internal.vm.compiler@11.0.9 jdk.internal.vm.compiler.management@11.0.9 jdk.jartool@11.0.9 jdk.javadoc@11.0.9 jdk.jcmd@11.0.9 jdk.jconsole@11.0.9 jdk.jdeps@11.0.9 jdk.jdi@11.0.9 jdk.jdwp.agent@11.0.9 jdk.jfr@11.0.9 jdk.jlink@11.0.9 jdk.jshell@11.0.9 jdk.jsobject@11.0.9 jdk.jstatd@11.0.9 jdk.localedata@11.0.9 jdk.management@11.0.9 jdk.management.agent@11.0.9 jdk.management.jfr@11.0.9 jdk.naming.dns@11.0.9 jdk.naming.ldap@11.0.9 jdk.naming.rmi@11.0.9 jdk.net@11.0.9 jdk.pack@11.0.9 jdk.rmic@11.0.9 jdk.scripting.nashorn@11.0.9 jdk.scripting.nashorn.shell@11.0.9 jdk.sctp@11.0.9 jdk.security.auth@11.0.9 jdk.security.jgss@11.0.9 jdk.unsupported@11.0.9 jdk.unsupported.desktop@11.0.9 jdk.xml.dom@11.0.9 jdk.zipfs@11.0.9 </pre> [[Category:Java]]
返回
Java:Module
。