目录
Jdeps工具:
jdeprscan 工具:
首页 Java java教程 Java 9中Jdeps和Jdeprscan工具之间的区别是什么?

Java 9中Jdeps和Jdeprscan工具之间的区别是什么?

Sep 16, 2023 pm 03:21 PM

Java 9中Jdeps和Jdeprscan工具之间的区别是什么?

Jdeps工具可用于分析我们的类的依赖关系。运行“jdeps -jdkinternals jararchive.jar”命令会打印使用 Java 内部 API 的所有类的列表。 Jdeps 工具返回依赖项的详细描述,而 Jdeprscan 是另一个有用的工具,特别与“-for-removal”标志结合使用。此工具向我们显示给定 jar 存档对已弃用的 API的所有使用,并且只能显示 jdk 方法的已弃用的使用,并且无法使用此工具检查第三方 jar 中的弃用情况.

Jdeps工具:

  • jdeps”是一个类依赖分析工具,可用于包级别和类级别依赖关系。
  • jdeps class_file”命令打印给定类文件的包级别依赖关系。
  • “jdeps” -verbose”命令打印类级依赖关系。
  • jdeps jar_file”命令打印给定 jar 文件的包级依赖关系。
  • jdeps --inverse --require module_name”命令打印给定 java 模块的包级反向依赖关系。

在下面,我们可以使用“jdeps --help”命令查看完整的选项列表。

<strong>C:\Users\user>jdeps --help
Usage: jdeps <options> <path ...>]
<path> can be a pathname to a .class file, a directory, a JAR file.

Possible options include:
  -dotoutput <dir>
  --dot-output <dir>      Destination directory for DOT file output
  -s        -summary      Print dependency summary only.
  -v        -verbose      Print all class level dependences
                          Equivalent to -verbose:class -filter:none.
  -verbose:package        Print package-level dependences excluding
                          dependences within the same package by default
  -verbose:class          Print class-level dependences excluding
                          dependences within the same package by default
  -apionly
  --api-only              Restrict analysis to APIs i.e. dependences
                          from the signature of public and protected
                          members of public classes including field
                          type, method parameter types, returned type,
                          checked exception types etc.
  -jdkinternals
  --jdk-internals         Finds class-level dependences on JDK internal
                          APIs. By default, it analyzes all classes
                          on --class-path and input files unless -include
                          option is specified. This option cannot be
                          used with -p, -e and -s options.
                          WARNING: JDK internal APIs are inaccessible.
--check <module-name>[,<module-name>...
                          Analyze the dependence of the specified modules
                          It prints the module descriptor, the resulting
                          module dependences after analysis and the
                          graph after transition reduction. It also
                          identifies any unused qualified exports.
  --generate-module-info <dir>
                          Generate module-info.java under the specified
                          directory. The specified JAR files will be
                          analyzed. This option cannot be used with
                          --dot-output or --class-path. Use
                          --generate-open-module option for open modules.
  --generate-open-module <dir>
                          Generate module-info.java for the specified
                          JAR files under the specified directory as
                          open modules. This option cannot be used with
                          --dot-output or --class-path.
  --list-deps             Lists the dependences and use of JDK internal APIs.
  --list-reduced-deps     Same as --list-deps with not listing
                          the implied reads edges from the module graph
                          If module M1 depends on M2 and M3,
                          M2 requires public on M3, then M1 reading M3 is
                          implied and removed from the module graph.
  -cp <path>
  -classpath <path>
  --class-path <path>     Specify where to find class files
  --module-path <module path>
                          Specify module path
  --upgrade-module-path <module path>
                          Specify upgrade module path
  --system <java-home>    Specify an alternate system module path
  --add-modules <module-name>[,<module-name>...]
                          Adds modules to the root set for analysis
  -m <module-name>
  --module <module-name>  Specify the root module for analysis
  --multi-release <version>
                          Specifies the version when processing
                          multi-release jar files. should
                          be integer >= 9 or base.

Options to filter dependences:
  -p <pkg>
  -package <pkg>
  --package <pkg>           Finds dependences matching the given package
                            name (may be given multiple times).
  -e <regex>
  -regex <regex>
  --regex <regex>           Finds dependences matching the given pattern.
  --require <module-name>   Finds dependences matching the given module
                            name (may be given multiple times). --package,
                            --regex, --require are mutual exclusive.
  -f <regex> -filter <regex> Filter dependences matching the given
                             pattern. If given multiple times, the last
                             one will be used.
  -filter:package            Filter dependences within the same package.
                             This is the default.
  -filter:archive            Filter dependences within the same archive.
  -filter:module             Filter dependences within the same module.
  -filter:none               No -filter:package and -filter:archive
                             filtering. Filtering specified via the
                             -filter option still applies.

Options to filter classes to be analyzed:
  -include <regex>           Restrict analysis to classes matching pattern
                             This option filters the list of classes to
                             be analyzed. It can be used together with
                             -p and -e which apply pattern to the dependences

  -P         -profile        Show profile containing a package
  -R         -recursive      Recursively traverse all run-time dependences.
                             The -R option implies -filter:none. If -p,
                             -e, -f option is specified, only the matching
                             dependences are analyzed.
  -I          --inverse      Analyzes the dependences per other given options

                             and then find all artifacts that directly
                             and indirectly depend on the matching nodes.
                             This is equivalent to the inverse of
                             compile-time view analysis and print
                             dependency summary. This option must use
                             with --require, --package or --regex option.
  --compile-time             Compile-time view of transitive dependences
                             i.e. compile-time view of -R option.
                             Analyzes the dependences per other given options
 
                             If a dependence is found from a directory,
                             a JAR file or a module, all c*lasses in that
                             containing archive are analyzed.
  -q           - quiet       Do not show missing dependences from
                             --generate-module-info output.
  -version     --version     Version information</strong>
登录后复制

jdeprscan 工具:

  • jdeprscan”是一个 Java 弃用 API 扫描器工具,可用于扫描弃用的 API 元素。
  • jdeprscan class_file”命令扫描给定 jJava 类文件中已弃用的 API。
  • jdeprscan jar_file”命令扫描给定 jar 文件的已弃用 API。
  • jdeprscan --release X”命令扫描特定 JDK 版本的已弃用 API。
  • jdeprscan --list --release X”命令列出了特定 JDK 版本的所有已弃用的 API。

在下面,我们可以使用“< strong>jdeprscan --help”命令查看完整的选项列表。

<strong>C:\Users\User>jdeprscan --help
Usage: jdeprscan [options] {dir|jar|class} ...

options:
 --class-path PATH
 --for-removal
 --full-version
 -h --help
 -l --list
 --release 6|7|8|9
 -v --verbose
 --version

Scans each argument for usages of deprecated APIs. An argument may be a directory specifying the root of a package hierarchy,
a JAR file, a class file, or a class name. The class name must be specified using a fully qualified class name using the $ separator
character for nested classes, for example,
java.lang.Thread$State
The --class-path option provides a search path for resolution of dependent classes.
The --for-removal option limits scanning or listing to APIs that are
deprecated for removal. Cannot be used with a release value of 6, 7, or 8.
The --full-version option prints out the full version string of the tool.
The --help option prints out a full help message.
The --list (-l) option prints out the set of deprecated APIs. No scanning is done,
so no directory, jar, or class arguments should be provided.
The --release option specifies the Java SE release that provides the set of deprecated APIs for scanning.
The --verbose (-v) option enables additional message output during processing.
The --version option prints out the abbreviated version string of the tool.</strong>
登录后复制

以上是Java 9中Jdeps和Jdeprscan工具之间的区别是什么?的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

Java的类负载机制如何起作用,包括不同的类载荷及其委托模型? Java的类负载机制如何起作用,包括不同的类载荷及其委托模型? Mar 17, 2025 pm 05:35 PM

Java的类上载涉及使用带有引导,扩展程序和应用程序类负载器的分层系统加载,链接和初始化类。父代授权模型确保首先加载核心类别,从而影响自定义类LOA

如何使用咖啡因或Guava Cache等库在Java应用程序中实现多层缓存? 如何使用咖啡因或Guava Cache等库在Java应用程序中实现多层缓存? Mar 17, 2025 pm 05:44 PM

本文讨论了使用咖啡因和Guava缓存在Java中实施多层缓存以提高应用程序性能。它涵盖设置,集成和绩效优势,以及配置和驱逐政策管理最佳PRA

如何在Java中实施功能编程技术? 如何在Java中实施功能编程技术? Mar 11, 2025 pm 05:51 PM

本文使用lambda表达式,流API,方法参考和可选探索将功能编程集成到Java中。 它突出显示了通过简洁性和不变性改善代码可读性和可维护性等好处

如何将JPA(Java持久性API)用于具有高级功能(例如缓存和懒惰加载)的对象相关映射? 如何将JPA(Java持久性API)用于具有高级功能(例如缓存和懒惰加载)的对象相关映射? Mar 17, 2025 pm 05:43 PM

本文讨论了使用JPA进行对象相关映射,并具有高级功能,例如缓存和懒惰加载。它涵盖了设置,实体映射和优化性能的最佳实践,同时突出潜在的陷阱。[159个字符]

如何将Maven或Gradle用于高级Java项目管理,构建自动化和依赖性解决方案? 如何将Maven或Gradle用于高级Java项目管理,构建自动化和依赖性解决方案? Mar 17, 2025 pm 05:46 PM

本文讨论了使用Maven和Gradle进行Java项目管理,构建自动化和依赖性解决方案,以比较其方法和优化策略。

如何将Java的Nio(新输入/输出)API用于非阻滞I/O? 如何将Java的Nio(新输入/输出)API用于非阻滞I/O? Mar 11, 2025 pm 05:51 PM

本文使用选择器和频道使用单个线程有效地处理多个连接的Java的NIO API,用于非阻滞I/O。 它详细介绍了过程,好处(可伸缩性,性能)和潜在的陷阱(复杂性,

如何使用适当的版本控制和依赖项管理创建和使用自定义Java库(JAR文件)? 如何使用适当的版本控制和依赖项管理创建和使用自定义Java库(JAR文件)? Mar 17, 2025 pm 05:45 PM

本文使用Maven和Gradle之类的工具讨论了具有适当的版本控制和依赖关系管理的自定义Java库(JAR文件)的创建和使用。

如何使用Java的插座API进行网络通信? 如何使用Java的插座API进行网络通信? Mar 11, 2025 pm 05:53 PM

本文详细介绍了用于网络通信的Java的套接字API,涵盖了客户服务器设置,数据处理和关键考虑因素,例如资源管理,错误处理和安全性。 它还探索了性能优化技术,我

See all articles