列出应用程序启动期间解析的模块 [英] List the modules resolved during the application startup

查看:130
本文介绍了列出应用程序启动期间解析的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在启动应用程序时了解已解析的模块列表,以便确定从根模块可以访问的所有服务提供程序。

How can one get to know of the list of modules that have been resolved while the application has been started so as to figure out what all service providers are accessible from the root module.

推荐答案

模块分辨率



模块解析是一个两步过程。

Module Resolution

The module resolution is a two-step process.


  • 第一步递归枚举一组根模块的'requires'指令。

  • 如果所有枚举模块都是可观察的,那么第二步计算它们的可读性图。可读性图表体现了模块之间的相互依赖关系,这反过来又控制了跨模块边界的访问。

可以使用 <中提到的调试标志。 code> java 工具文档通过VM参数:

One can make use of the debugging flag as mentioned in the java tool documentation by means of a VM argument :

--show-module-resolution




显示启动期间的模块分辨率输出。

Shows module resolution output during startup.

例如,该选项将列出:


  • root module

  • 根模块需要和解决的所有模块

  • 上述模块使用的进一步绑定和

  • 启动时解析的连续模块

  • root module
  • all the modules required and resolved by the root module
  • further bindings used by the above-required modules and
  • successive modules resolved during startup

运行后续操作wing命令:

On running the following command:


Jigsaw git:(master) ✗ ../jdk-9.0.1.jdk/Contents/Home/bin/java 
                       --show-module-resolution 
                       -p ../out/production/100DaysOfJava9 
                       -m HundredDaysOfJavaNine/com.stackoverflow.nullpointer.Challenge1







它导致以下: -


It results in the following:-

root HundredDaysOfJavaNine file:///.../out/production/100DaysOfJava9/

HundredDaysOfJavaNine requires jdk.incubator.httpclient jrt:/jdk.incubator.httpclient

java.base binds jdk.localedata jrt:/jdk.localedata
java.base binds java.security.jgss jrt:/java.security.jgss
java.base binds java.logging jrt:/java.logging
java.base binds jdk.javadoc jrt:/jdk.javadoc
java.base binds jdk.jartool jrt:/jdk.jartool
java.base binds jdk.jlink jrt:/jdk.jlink
java.base binds jdk.compiler jrt:/jdk.compiler
java.base binds jdk.jdeps jrt:/jdk.jdeps
java.base binds java.desktop jrt:/java.desktop
java.base binds jdk.zipfs jrt:/jdk.zipfs
...

这篇关于列出应用程序启动期间解析的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆