LinuxCommandLibrary

jdeps

analyzes Java class dependencies

TLDR

Analyze class dependencies

$ jdeps [class.jar]
copy
Show package-level dependencies
$ jdeps -s [class.jar]
copy
Check for JDK internal API usage
$ jdeps --jdk-internals [class.jar]
copy
Generate module-info
$ jdeps --generate-module-info [dir] [class.jar]
copy
Analyze specific package
$ jdeps -p [com.example] [class.jar]
copy
Multi-release JAR analysis
$ jdeps --multi-release [17] [class.jar]
copy

SYNOPSIS

jdeps [options] path...

DESCRIPTION

jdeps analyzes Java class dependencies. It shows which packages and modules a JAR depends on.
The tool helps with Java module migration. It identifies use of internal JDK APIs that may break in future versions.

PARAMETERS

PATH

JAR file or class directory.
-s, --summary
Summary level output.
--jdk-internals
Check for internal API use.
--generate-module-info DIR
Generate module-info.java.
-p PACKAGE
Analyze specific package.
--multi-release VERSION
Analyze multi-release JAR.
--help
Display help information.

CAVEATS

Part of JDK. Requires class files not source. Output format may vary.

HISTORY

jdeps was added in JDK 8 to help developers understand dependencies and prepare for the Java module system in JDK 9.

SEE ALSO

javap(1), java(1), jar(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community