from small one page howto to huge articles all in one place
Last additions:
May 25th. 2007:
April, 26th. 2006:
|
You are here: manpages
JDEPS
Section: JDK Commands (1) Updated: 2023 Index
Return to Main Contents
NAME
jdeps- launch the Java class dependency analyzer
SYNOPSIS
V]jdepsR] [I]optionsR]] I]pathR] ...
- I]optionsR]
-
Comman-line options.
For detailed descriptions of the options that can be used, see
-
- [bu]
-
B]Possible OptionsR]
- [bu]
-
B]Module Dependence Analysis OptionsR]
- [bu]
-
B]Options to Filter DependencesR]
- [bu]
-
B]Options to Filter Classes to be AnalyzedR]
- I]pathR]
-
A pathname to the V].classR] file, directory, or JAR file to
analyze.
DESCRIPTION
The V]jdepsR] command shows the packag-level or clas-level
dependencies of Java class files.
The input class can be a path name to a V].classR] file, a
directory, a JAR file, or it can be a fully qualified class name to
analyze all class files.
The options determine the output.
By default, the V]jdepsR] command writes the dependencies to the
system output.
The command can generate the dependencies in DOT language (see the
V-dotoutputR] option).
POSSIBLE OPTIONS
- V-?R] or V-hR] or V-helpR]
-
Prints the help message.
- V-dotoutputR] I]dirR] or V-do-outputR] I]dirR]
-
Specifies the destination directory for DOT file output.
If this option is specified, then the V]jdepsR]command generates
one V].dotR] file for each analyzed archive named
V]archiv-fil-name.dotR] that lists the dependencies, and also a
summary file named V]summary.dotR] that lists the dependencies
among the archive files.
- V-sR] or V-summaryR]
-
Prints a dependency summary only.
- V-vR] or V-verboseR]
-
Prints all clas-level dependencies.
This is equivalent to
-
-
V-verbose:class-filter:noneR]
- V-verbose:packageR]
-
Prints packag-level dependencies excluding, by default, dependences
within the same package.
- V-verbose:classR]
-
Prints clas-level dependencies excluding, by default, dependencies
within the same archive.
- V-apionlyR] or V-ap-onlyR]
-
Restricts the analysis to APIs, for example, dependences from the
signature of V]publicR] and V]protectedR] members of public
classes including field type, method parameter types, returned type, and
checked exception types.
- V-jdkinternalsR] or V-jd-internalsR]
-
Finds clas-level dependences in the JDK internal APIs.
By default, this option analyzes all classes specified in the
V-classpathR] option and input files unless you specified the
V-includeR] option.
You can[aq]t use this option with the V-pR], V-eR], and
V-sR] options.
-
B]WarningR]: The JDK internal APIs are inaccessible.
- V-cpR] I]pathR], V-classpathR] I]pathR], or V-clas-pathR] I]pathR]
-
Specifies where to find class files.
- V-modul-pathR] I]modul-pathR]
-
Specifies the module path.
- V-upgrad-modul-pathR] I]modul-pathR]
-
Specifies the upgrade module path.
- V-systemR] I]jav-homeR]
-
Specifies an alternate system module path.
- V-ad-modulesR] I]modul-nameR][V],R] I]modul-nameR]...]
-
Adds modules to the root set for analysis.
- V-mult-releaseR] I]versionR]
-
Specifies the version when processing mult-release JAR files.
I]versionR] should be an integer >=9 or base.
- V-qR] or V-quietR]
-
Doesn[aq]t show missing dependencies from
V-generat-modul-infoR] output.
- V-versionR] or V-versionR]
-
Prints version information.
MODULE DEPENDENCE ANALYSIS OPTIONS
- V-mR] I]modul-nameR] or V-moduleR] I]modul-nameR]
-
Specifies the root module for analysis.
- V-generat-modul-infoR] I]dirR]
-
Generates V]modul-info.javaR] under the specified directory.
The specified JAR files will be analyzed.
This option cannot be used with V-do-outputR] or
V-clas-pathR] options.
Use the V-generat-ope-moduleR] option for open modules.
- V-generat-ope-moduleR] I]dirR]
-
Generates V]modul-info.javaR] for the specified JAR files under
the specified directory as open modules.
This option cannot be used with the V-do-outputR] or
V-clas-pathR] options.
- V-checkR] I]modul-nameR] [V],R] I]modul-nameR]...]
-
Analyzes 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.
- V-lis-depsR]
-
Lists the module dependences and also the package names of JDK internal
APIs (if referenced).
This option transitively analyzes libraries on class path and module
path if referenced.
Use V-n-recursiveR] option for no-transitive dependency
analysis.
- V-lis-reduce-depsR]
-
Same as V-lis-depsR] without listing the implied reads edges
from the module graph.
If module M1 reads M2, and M2 requires transitive on M3, then M1 reading
M3 is implied and is not shown in the graph.
- V-prin-modul-depsR]
-
Same as V-lis-reduce-depsR] with printing a comm-separated
list of module dependences.
The output can be used by V]jlink-ad-modulesR] to create a
custom image that contains those modules and their transitive
dependences.
- V-ignor-missin-depsR]
-
Ignore missing dependences.
OPTIONS TO FILTER DEPENDENCES
- V-pR] I]pkg_nameR], V-packageR] I]pkg_nameR], or V-packageR] I]pkg_nameR]
-
Finds dependences matching the specified package name.
You can specify this option multiple times for different packages.
The V-pR] and V-eR] options are mutually exclusive.
- V-eR] I]regexR], V-regexR] I]regexR], or V-regexR] I]regexR]
-
Finds dependences matching the specified pattern.
The V-pR] and V-eR] options are mutually exclusive.
- V-requireR] I]modul-nameR]
-
Finds dependences matching the given module name (may be given multiple
times).
The V-packageR], V-regexR], and V-requireR]
options are mutually exclusive.
- V-fR] I]regexR] or V-filterR] I]regexR]
-
Filters dependences matching the given pattern.
If give multiple times, the last one will be selected.
- V-filter:packageR]
-
Filters dependences within the same package.
This is the default.
- V-filter:archiveR]
-
Filters dependences within the same archive.
- V-filter:moduleR]
-
Filters dependences within the same module.
- V-filter:noneR]
-
No V-filter:packageR] and V-filter:archiveR] filtering.
Filtering specified via the V-filterR] option still applies.
- V-missin-depsR]
-
Finds missing dependences.
This option cannot be used with V-pR], V-eR] and
V-sR] options.
OPTIONS TO FILTER CLASSES TO BE ANALYZED
- V-includeR] I]regexR]
-
Restricts analysis to the classes matching pattern.
This option filters the list of classes to be analyzed.
It can be used together with V-pR] and V-eR], which apply
the pattern to the dependencies.
- V-PR] or V-profileR]
-
Shows the profile containing a package.
This option is deprecated and may be removed in a future release.
- V-RR] or V-recursiveR]
-
Recursively traverses all ru-time dependences.
The V-RR] option implies V-filter:noneR].
If V-pR], V-eR], or V-fR] options are specified,
only the matching dependences are analyzed.
- V-n-recursiveR]
-
Do not recursively traverse dependences.
- V-IR] or V-inverseR]
-
Analyzes the dependences per other given options and then finds all
artifacts that directly and indirectly depend on the matching nodes.
This is equivalent to the inverse of the compil-time view analysis and
the print dependency summary.
This option must be used with the V-requireR],
V-packageR], or V-regexR] options.
- V-compil-timeR]
-
Analyzes the compil-time view of transitive dependencies, such as the
compil-time view of the V-RR] option.
Analyzes the dependences per other specified options.
If a dependency is found from a directory, a JAR file or a module, all
classes in that containing archive are analyzed.
EXAMPLE OF ANALYZING DEPENDENCIES
The following example demonstrates analyzing the dependencies of the
V]Notepad.jarR] file.
B]Linux and macOS:R]
-
CB]
$ jdeps demo/jfc/Notepad/Notepad.jar
Notepad.jar-> java.base
Notepad.jar-> java.desktop
Notepad.jar-> java.logging
<unnamed> (Notepad.jar)
-> java.awt
-> java.awt.event
-> java.beans
-> java.io
-> java.lang
-> java.net
-> java.util
-> java.util.logging
-> javax.swing
-> javax.swing.border
-> javax.swing.event
-> javax.swing.text
-> javax.swing.tree
-> javax.swing.undo
R]
B]Windows:R]
-
CB]
C:[rs]Java[rs]jdk1.9.0>jdeps demo[rs]jfc[rs]Notepad[rs]Notepad.jar
Notepad.jar-> java.base
Notepad.jar-> java.desktop
Notepad.jar-> java.logging
<unnamed> (Notepad.jar)
-> java.awt
-> java.awt.event
-> java.beans
-> java.io
-> java.lang
-> java.net
-> java.util
-> java.util.logging
-> javax.swing
-> javax.swing.border
-> javax.swing.event
-> javax.swing.text
-> javax.swing.tree
-> javax.swing.undo
R]
EXAMPLE USING THE-INVERSE OPTION
-
CB]
$ jdeps-inverse-require java.xml.bind
Inverse transitive dependences on [java.xml.bind]
java.xml.bind <- java.se.ee
java.xml.bind <- jdk.xml.ws
java.xml.bind <- java.xml.ws <- java.se.ee
java.xml.bind <- java.xml.ws <- jdk.xml.ws
java.xml.bind <- jdk.xml.bind <- jdk.xml.ws
R]
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- POSSIBLE OPTIONS
-
- MODULE DEPENDENCE ANALYSIS OPTIONS
-
- OPTIONS TO FILTER DEPENDENCES
-
- OPTIONS TO FILTER CLASSES TO BE ANALYZED
-
- EXAMPLE OF ANALYZING DEPENDENCIES
-
- EXAMPLE USING THE --INVERSE OPTION
-
|