JDEPS(1)

πŸ“¦
version 27.0.0.0.35 Β· 35 versions
, in epel 10, epel 9

πŸ‘‘ JDEPS(1) β€” like, the Java class dependency analyzer, bestie πŸ’…

okay so this is from the JDK Commands manual and honestly? it's a whole vibe. jdeps is the little icon that tells you what your Java classes are depending on. let's get into it 🫢


✨ NAME ✨

jdeps β€” launch the Java class dependency analyzer 🌈

✨ SYNOPSIS ✨

jdeps [options] path ...
  • options β€” command-line options, obviously πŸ’– for the detailed descriptions of the options you can use, see:
    • Possible Options
    • Module Dependence Analysis Options
    • Options to Filter Dependences
    • Options to Filter Classes to be Analyzed
  • path β€” a pathname to the .class file, directory, or JAR file to analyze πŸŽ€

✨ DESCRIPTION ✨

so the jdeps command shows the package-level or class-level dependencies of Java class files. literally its whole thing πŸ’…

the input class can be a path name to a .class 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 jdeps command writes the dependencies to the system output. and get this β€” the command can generate the dependencies in DOT language (see the -dotoutput option). slay ✨


πŸŽ€ POSSIBLE OPTIONS πŸŽ€

  • -? or -h or --help β€” prints the help message πŸ’–
  • -dotoutput dir or --dot-output dir β€” specifies the destination directory for DOT file output. if this option is specified, then the jdeps command generates one .dot file for each analyzed archive named archive-file-name.dot that lists the dependencies, and also a summary file named summary.dot that lists the dependencies among the archive files πŸ¦‹
  • -s or -summary β€” prints a dependency summary only. short and sweet, periodt πŸ’…
  • -v or -verbose β€” prints all class-level dependencies. this is equivalent to
-verbose:class -filter:none
  • -verbose:package β€” prints package-level dependencies excluding, by default, dependencies within the same package 🌸
  • -verbose:class β€” prints class-level dependencies excluding, by default, dependencies within the same archive 🌸
  • -apionly or --api-only β€” restricts the analysis to APIs, for example, dependences from the signature of public and protected members of public classes including field type, method parameter types, returned type, and checked exception types πŸ”₯
  • -jdkinternals or --jdk-internals β€” finds class-level dependences in the JDK internal APIs. by default, this option analyzes all classes specified in the --class-path option and input files unless you specified the -include option. you can't use this option with the -p, -e, and -s options πŸ™ˆ
⚠️ Warning: The JDK internal APIs are inaccessible. (yes, for real β€” that's a warning, bestie, so like… be careful πŸ’€)
  • -cp path, -classpath path, or --class-path path β€” specifies where to find class files πŸŽ€
  • --module-path module-path β€” specifies the module path ✨
  • --upgrade-module-path module-path β€” specifies the upgrade module path ✨
  • --system java-home β€” specifies an alternate system module path ✨
  • --add-modules module-name[, module-name...] β€” adds modules to the root set for analysis πŸ‘‘
  • --multi-release version β€” specifies the version when processing multi-release JAR files. version should be an integer >= 9 or base 🧚
  • -q or -quiet β€” doesn't show missing dependencies from -generate-module-info output 🀫
  • -version or --version β€” prints version information ⭐

πŸ¦‹ MODULE DEPENDENCE ANALYSIS OPTIONS πŸ¦‹

  • -m module-name or --module module-name β€” specifies the root module for analysis πŸ’œ
  • --generate-module-info dir β€” generates 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 options. use the --generate-open-module option for open modules πŸŽ€
  • --generate-open-module dir β€” generates module-info.java for the specified JAR files under the specified directory as open modules. this option cannot be used with the --dot-output or --class-path options πŸŽ€
  • --check module-name [, module-name...] β€” 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 πŸ‘‘
  • --list-deps β€” 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 --no-recursive option for non-transitive dependency analysis 🌸
  • --list-reduced-deps β€” same as --list-deps 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 πŸ’…
  • --print-module-deps β€” same as --list-reduced-deps with printing a comma-separated list of module dependences. the output can be used by jlink --add-modules to create a custom image that contains those modules and their transitive dependences πŸ”₯
  • --ignore-missing-deps β€” ignore missing dependences. not me ignoring my problems… but make it modules 😭

πŸ’… OPTIONS TO FILTER DEPENDENCES πŸ’…

  • -p pkg_name, -package pkg_name, or --package pkg_name β€” finds dependences matching the specified package name. you can specify this option multiple times for different packages. the -p and -e options are mutually exclusive 🫢
  • -e regex, -regex regex, or --regex regex β€” finds dependences matching the specified pattern. the -p and -e options are mutually exclusive 🫢
  • --require module-name β€” finds dependences matching the given module name (may be given multiple times). the --package, --regex, and --require options are mutually exclusive ⭐
  • -f regex or -filter regex β€” filters dependences matching the given pattern. if give multiple times, the last one will be selected πŸ‘€
  • -filter:package β€” filters dependences within the same package. this is the default πŸŽ€
  • -filter:archive β€” filters dependences within the same archive πŸŽ€
  • -filter:module β€” filters dependences within the same module πŸŽ€
  • -filter:none β€” no -filter:package and -filter:archive filtering. filtering specified via the -filter option still applies ✨
  • --missing-deps β€” finds missing dependences. this option cannot be used with -p, -e and -s options 🌸

🧚 OPTIONS TO FILTER CLASSES TO BE ANALYZED 🧚

  • -include regex β€” restricts analysis to the classes matching pattern. this option filters the list of classes to be analyzed. it can be used together with -p and -e, which apply the pattern to the dependencies πŸ’–
  • -R or --recursive β€” recursively traverses all run-time dependences. the -R option implies -filter:none. if -p, -e, or -f options are specified, only the matching dependences are analyzed πŸŒ€
  • --no-recursive β€” do not recursively traverse dependences πŸ™…
  • -I or --inverse β€” 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 compile-time view analysis and the print dependency summary. this option must be used with the --require, --package, or --regex options πŸ”₯
  • --compile-time β€” analyzes the compile-time view of transitive dependencies, such as the compile-time view of the -R 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 Notepad.jar file. iconic behavior honestly πŸ“

Linux and macOS:

$ 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

Windows:

C:\Java\jdk1.9.0>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

🌸 EXAMPLE USING THE --INVERSE OPTION 🌸

$ 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

🫢 and that's the whole page, bestie. go analyze some dependencies, you're gonna eat πŸ’…βœ¨

later, legend β€” this one's from the JDK 27-ea era, dated 2026, straight out of the JDK Commands manual πŸŽ€πŸ’œ

πŸ“¦ where this page comes from
  • epel 10: java-latest-openjdk-devel 1:27.0.0.0.35-0.0.1.0.ea.el10_3 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 10: java-latest-openjdk-devel-fastdebug 1:27.0.0.0.35-0.0.1.0.ea.el10_3 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 10: java-latest-openjdk-devel-slowdebug 1:27.0.0.0.35-0.0.1.0.ea.el10_3 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 9: java-latest-openjdk-devel 1:27.0.0.0.35-0.0.1.0.ea.el9 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 9: java-latest-openjdk-devel-fastdebug 1:27.0.0.0.35-0.0.1.0.ea.el9 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • epel 9: java-latest-openjdk-devel-slowdebug 1:27.0.0.0.35-0.0.1.0.ea.el9 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms