jdeps
analyzes Java class dependencies
TLDR
SYNOPSIS
jdeps [options] path...
DESCRIPTION
jdeps is the Java class dependency analyzer. It shows the package-level or class-level dependencies of Java class files, and which JARs and JDK modules they rely on.The tool helps with migrating to the Java module system and with building minimal runtimes: --print-module-deps feeds directly into jlink, and --jdk-internals flags use of internal JDK APIs that are inaccessible under strong encapsulation (JDK 16+) or may be removed.
PARAMETERS
PATH
A .class file, a directory of classes, or a JAR file.-s, -summary
Print dependency summary only.-v, -verbose
Print all class-level dependencies (same as -verbose:class -filter:none).-verbose:package, -verbose:class
Print package-level (default) or class-level dependencies.-cp, --class-path path
Where to find dependent class files.--module-path path
Module path.--multi-release VERSION
Version to use when processing multi-release JARs (integer >= 9, or base).--jdk-internals
Find class-level dependencies on JDK internal APIs. Cannot be combined with -p, -e or -s.-p, --package PACKAGE
Find dependencies matching the given package (repeatable).-e, --regex REGEX
Find dependencies matching the given pattern.--require MODULE
Find dependencies on the given module.-include REGEX
Restrict analysis to classes matching the pattern.-R, --recursive
Recursively traverse all run-time dependencies.--api-only
Only consider dependencies from public API signatures.--list-deps, --list-reduced-deps
List module dependencies (the reduced form omits implied reads edges).--print-module-deps
Print a comma-separated list of module dependencies, suitable for jlink --add-modules.--ignore-missing-deps
Ignore missing dependencies instead of failing.--missing-deps
Find missing dependencies.--generate-module-info DIR
Generate module-info.java for the given JARs under DIR.--generate-open-module DIR
Like --generate-module-info, but generate open modules.--check MODULE[,...]
Analyze the given modules, print their descriptors and unused qualified exports.--dot-output DIR
Write DOT files for graph visualization.-q, -quiet
Suppress warning messages.--help
Display help information.
CAVEATS
Part of the JDK. Analyzes compiled class files, not source. Dependencies reached through reflection, ServiceLoader or string class names are not detected. Libraries missing from --class-path cause errors for module-level options unless --ignore-missing-deps is used.
HISTORY
jdeps was added in JDK 8 to help developers understand dependencies and prepare for the Java module system introduced in JDK 9, which added the module-related options.
