0

0

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

WBOY

WBOY

发布时间:2023-09-16 15:21:03

|

1246人浏览过

|

来源于tutorialspoint

转载

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”命令查看完整的选项列表。

讯飞听见会议
讯飞听见会议

科大讯飞推出的AI智能会议系统

下载
C:\Users\user>jdeps --help
Usage: jdeps  ]
 can be a pathname to a .class file, a directory, a JAR file.

Possible options include:
  -dotoutput 
  --dot-output       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 [,...
                          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 
                          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 
                          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 
  -classpath 
  --class-path      Specify where to find class files
  --module-path 
                          Specify module path
  --upgrade-module-path 
                          Specify upgrade module path
  --system     Specify an alternate system module path
  --add-modules [,...]
                          Adds modules to the root set for analysis
  -m 
  --module   Specify the root module for analysis
  --multi-release 
                          Specifies the version when processing
                          multi-release jar files. should
                          be integer >= 9 or base.

Options to filter dependences:
  -p 
  -package 
  --package            Finds dependences matching the given package
                            name (may be given multiple times).
  -e 
  -regex 
  --regex            Finds dependences matching the given pattern.
  --require    Finds dependences matching the given module
                            name (may be given multiple times). --package,
                            --regex, --require are mutual exclusive.
  -f  -filter  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            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

jdeprscan 工具:

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

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

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.
java速学教程(入门到精通)
java速学教程(入门到精通)

java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

相关标签:

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

相关专题

更多
java
java

Java是一个通用术语,用于表示Java软件及其组件,包括“Java运行时环境 (JRE)”、“Java虚拟机 (JVM)”以及“插件”。php中文网还为大家带了Java相关下载资源、相关课程以及相关文章等内容,供大家免费下载使用。

801

2023.06.15

java正则表达式语法
java正则表达式语法

java正则表达式语法是一种模式匹配工具,它非常有用,可以在处理文本和字符串时快速地查找、替换、验证和提取特定的模式和数据。本专题提供java正则表达式语法的相关文章、下载和专题,供大家免费下载体验。

722

2023.07.05

java自学难吗
java自学难吗

Java自学并不难。Java语言相对于其他一些编程语言而言,有着较为简洁和易读的语法,本专题为大家提供java自学难吗相关的文章,大家可以免费体验。

727

2023.07.31

java配置jdk环境变量
java配置jdk环境变量

Java是一种广泛使用的高级编程语言,用于开发各种类型的应用程序。为了能够在计算机上正确运行和编译Java代码,需要正确配置Java Development Kit(JDK)环境变量。php中文网给大家带来了相关的教程以及文章,欢迎大家前来阅读学习。

395

2023.08.01

java保留两位小数
java保留两位小数

Java是一种广泛应用于编程领域的高级编程语言。在Java中,保留两位小数是指在进行数值计算或输出时,限制小数部分只有两位有效数字,并将多余的位数进行四舍五入或截取。php中文网给大家带来了相关的教程以及文章,欢迎大家前来阅读学习。

398

2023.08.02

java基本数据类型
java基本数据类型

java基本数据类型有:1、byte;2、short;3、int;4、long;5、float;6、double;7、char;8、boolean。本专题为大家提供java基本数据类型的相关的文章、下载、课程内容,供大家免费下载体验。

445

2023.08.02

java有什么用
java有什么用

java可以开发应用程序、移动应用、Web应用、企业级应用、嵌入式系统等方面。本专题为大家提供java有什么用的相关的文章、下载、课程内容,供大家免费下载体验。

428

2023.08.02

java在线网站
java在线网站

Java在线网站是指提供Java编程学习、实践和交流平台的网络服务。近年来,随着Java语言在软件开发领域的广泛应用,越来越多的人对Java编程感兴趣,并希望能够通过在线网站来学习和提高自己的Java编程技能。php中文网给大家带来了相关的视频、教程以及文章,欢迎大家前来学习阅读和下载。

16860

2023.08.03

桌面文件位置介绍
桌面文件位置介绍

本专题整合了桌面文件相关教程,阅读专题下面的文章了解更多内容。

0

2025.12.30

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号