{
    "mode": "man",
    "parameter": "jdeps",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/jdeps/1/json",
    "generated": "2026-05-30T07:09:37Z",
    "synopsis": "jdeps [options] classes ...\noptions\nCommand-line options. See Options.\nclasses\nName of the classes to analyze. You can specify a class that can be found in the class\npath, by its file name, a directory, or a JAR file.",
    "sections": {
        "NAME": {
            "content": "jdeps - Java class dependency analyzer.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "jdeps [options] classes ...\n\n\noptions\nCommand-line options. See Options.\n\nclasses\nName of the classes to analyze. You can specify a class that can be found in the class\npath, by its file name, a directory, or a JAR file.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The jdeps command shows the package-level or class-level dependencies of Java class files.\nThe input class can be a path name to a .class file, a directory, a JAR file, or it can be a\nfully qualified class name to analyze all class files. The options determine the output. By\ndefault, jdeps outputs the dependencies to the system output. It can generate the\ndependencies in DOT language (see the -dotoutput option).\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-dotoutput <_dir_>",
                    "content": "Destination directory for DOT file output. If specified, jdeps will generate one dot\nfile per each analyzed archive named <archive-file-name>.dot listing the dependencies,\nand also a summary file named summary.dot listing the dependencies among the archives.\n"
                },
                {
                    "name": "-s, -summary",
                    "content": "Prints dependency summary only.\n",
                    "flag": "-s"
                },
                {
                    "name": "-v, -verbose",
                    "content": "Prints all class-level dependencies.\n\n-verbose:package\nPrints package-level dependencies excluding dependencies within the same archive.\n\n-verbose:class\nPrints class-level dependencies excluding dependencies within the same archive.\n",
                    "flag": "-v"
                },
                {
                    "name": "-cp <_path_>, -classpath <_path_>",
                    "content": "Specifies where to find class files.\n\nSee also Setting the Class Path.\n"
                },
                {
                    "name": "-p <_pkg_ _name_>, -package <_pkg_ _name_>",
                    "content": "Finds dependencies in the specified package. You can specify this option multiple\ntimes for different packages. The -p and -e options are mutually exclusive.\n",
                    "flag": "-p"
                },
                {
                    "name": "-e <_regex_>, -regex <_regex_>",
                    "content": "Finds dependencies in packages matching the specified regular expression pattern. The\n-p and -e options are mutually exclusive.\n",
                    "flag": "-e",
                    "arg": "<_regex_>"
                },
                {
                    "name": "-include <_regex_>",
                    "content": "Restricts analysis to classes matching pattern. This option filters the list of\nclasses to be analyzed. It can be used together with -p and -e which apply pattern to\nthe dependencies.\n"
                },
                {
                    "name": "-jdkinternals",
                    "content": "Finds class-level dependences in JDK internal APIs. By default, it analyzes all\nclasses specified in the -classpath option and in input files unless you specified the\n-include option. You cannot use this option with the -p, -e, and -s options.\n\nWarning: JDK internal APIs may not be accessible in upcoming releases.\n"
                },
                {
                    "name": "-P, -profile",
                    "content": "Shows profile or the file containing a package.\n",
                    "flag": "-P"
                },
                {
                    "name": "-apionly",
                    "content": "Restricts analysis to APIs, for example, dependences from the signature of public and\nprotected members of public classes including field type, method parameter types,\nreturned type, and checked exception types.\n"
                },
                {
                    "name": "-R, -recursive",
                    "content": "Recursively traverses all dependencies.\n",
                    "flag": "-R"
                },
                {
                    "name": "-version",
                    "content": "Prints version information.\n\n-h, -?, -help\nPrints help message for jdeps.\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "Analyzing the dependencies of Notepad.jar.\n",
            "subsections": [
                {
                    "name": "$ jdeps demo/jfc/Notepad/Notepad.jar",
                    "content": ""
                },
                {
                    "name": "demo/jfc/Notepad/Notepad.jar -> /usr/java/jre/lib/rt.jar",
                    "content": "<unnamed> (Notepad.jar)\n-> java.awt\n-> java.awt.event\n-> java.beans\n-> java.io\n-> java.lang\n-> java.net\n-> java.util\n-> java.util.logging\n-> javax.swing\n-> javax.swing.border\n-> javax.swing.event\n-> javax.swing.text\n-> javax.swing.tree\n-> javax.swing.undo\n\nUse -P or -profile option to show on which profile that Notepad depends.\n"
                },
                {
                    "name": "$ jdeps -profile demo/jfc/Notepad/Notepad.jar",
                    "content": ""
                },
                {
                    "name": "demo/jfc/Notepad/Notepad.jar -> /usr/java/jre/lib/rt.jar (Full JRE)",
                    "content": "<unnamed> (Notepad.jar)\n-> java.awt                                           Full JRE\n-> java.awt.event                                     Full JRE\n-> java.beans                                         Full JRE\n-> java.io                                            compact1\n-> java.lang                                          compact1\n-> java.net                                           compact1\n-> java.util                                          compact1\n-> java.util.logging                                  compact1\n-> javax.swing                                        Full JRE\n-> javax.swing.border                                 Full JRE\n-> javax.swing.event                                  Full JRE\n-> javax.swing.text                                   Full JRE\n-> javax.swing.tree                                   Full JRE\n-> javax.swing.undo                                   Full JRE\n\nAnalyzing the immediate dependencies of a specific class in a given classpath, for example\nthe com.sun.tools.jdeps.Main class in the tools.jar file.\n"
                },
                {
                    "name": "$ jdeps -cp lib/tools.jar com.sun.tools.jdeps.Main",
                    "content": ""
                },
                {
                    "name": "lib/tools.jar -> /usr/java/jre/lib/rt.jar",
                    "content": "com.sun.tools.jdeps (tools.jar)\n-> java.io\n-> java.lang\n\nUse the -verbose:class option to find class-level dependencies or use the -v or -verbose\noption to include dependencies from the same JAR file.\n"
                },
                {
                    "name": "$ jdeps -verbose:class -cp lib/tools.jar com.sun.tools.jdeps.Main",
                    "content": ""
                },
                {
                    "name": "lib/tools.jar -> /usr/java/jre/lib/rt.jar",
                    "content": "com.sun.tools.jdeps.Main (tools.jar)\n-> java.io.PrintWriter\n-> java.lang.Exception\n-> java.lang.Object\n-> java.lang.String\n-> java.lang.System\n\nUse the -R or -recursive option to analyze the transitive dependencies of the\ncom.sun.tools.jdeps.Main class.\n"
                },
                {
                    "name": "$ jdeps -R -cp lib/tools.jar com.sun.tools.jdeps.Main",
                    "content": ""
                },
                {
                    "name": "lib/tools.jar -> /usr/java/jre/lib/rt.jar",
                    "content": "com.sun.tools.classfile (tools.jar)\n-> java.io\n-> java.lang\n-> java.lang.reflect\n-> java.nio.charset\n-> java.nio.file\n-> java.util\n-> java.util.regex\ncom.sun.tools.jdeps (tools.jar)\n-> java.io\n-> java.lang\n-> java.nio.file\n-> java.nio.file.attribute\n-> java.text\n-> java.util\n-> java.util.jar\n-> java.util.regex\n-> java.util.zip"
                },
                {
                    "name": "/usr/java/jre/lib/jce.jar -> /usr/java/jre/lib/rt.jar",
                    "content": "javax.crypto (jce.jar)\n-> java.io\n-> java.lang\n-> java.lang.reflect\n-> java.net\n-> java.nio\n-> java.security\n-> java.security.cert\n-> java.security.spec\n-> java.util\n-> java.util.concurrent\n-> java.util.jar\n-> java.util.regex\n-> java.util.zip\n-> javax.security.auth\n-> sun.security.jca                                   JDK internal API (rt.jar)\n-> sun.security.util                                  JDK internal API (rt.jar)\njavax.crypto.spec (jce.jar)\n-> java.lang\n-> java.security.spec\n-> java.util"
                },
                {
                    "name": "/usr/java/jre/lib/rt.jar -> /usr/java/jre/lib/jce.jar",
                    "content": "java.security (rt.jar)\n-> javax.crypto\n\nGenerate dot files of the dependencies of Notepad demo.\n"
                },
                {
                    "name": "$ jdeps -dotoutput dot demo/jfc/Notepad/Notepad.jar",
                    "content": "jdeps will create one dot file for each given JAR file named <filename>.dot in the dot\ndirectory specified in the -dotoutput option, and also a summary file named summary.dot that\nwill list the dependencies among the JAR files\n"
                },
                {
                    "name": "$ cat dot/Notepad.jar.dot",
                    "content": ""
                },
                {
                    "name": "digraph \"Notepad.jar\" {",
                    "content": "// Path: demo/jfc/Notepad/Notepad.jar\n\"<unnamed>\"                                        -> \"java.awt\";\n\"<unnamed>\"                                        -> \"java.awt.event\";\n\"<unnamed>\"                                        -> \"java.beans\";\n\"<unnamed>\"                                        -> \"java.io\";\n\"<unnamed>\"                                        -> \"java.lang\";\n\"<unnamed>\"                                        -> \"java.net\";\n\"<unnamed>\"                                        -> \"java.util\";\n\"<unnamed>\"                                        -> \"java.util.logging\";\n\"<unnamed>\"                                        -> \"javax.swing\";\n\"<unnamed>\"                                        -> \"javax.swing.border\";\n\"<unnamed>\"                                        -> \"javax.swing.event\";\n\"<unnamed>\"                                        -> \"javax.swing.text\";\n\"<unnamed>\"                                        -> \"javax.swing.tree\";\n\"<unnamed>\"                                        -> \"javax.swing.undo\";\n}"
                },
                {
                    "name": "$ cat dot/summary.dot",
                    "content": ""
                },
                {
                    "name": "digraph \"summary\" {",
                    "content": "\"Notepad.jar\"                  -> \"rt.jar\";\n}\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "• javap(1)\n\n\n\nJDK 8                                     21 November 2013                                  jdeps(1)",
            "subsections": []
        }
    },
    "summary": "jdeps - Java class dependency analyzer.",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Destination directory for DOT file output. If specified, jdeps will generate one dot file per each analyzed archive named <archive-file-name>.dot listing the dependencies, and also a summary file named summary.dot listing the dependencies among the archives."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Prints dependency summary only."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "Prints all class-level dependencies. -verbose:package Prints package-level dependencies excluding dependencies within the same archive. -verbose:class Prints class-level dependencies excluding dependencies within the same archive."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Specifies where to find class files. See also Setting the Class Path."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Finds dependencies in the specified package. You can specify this option multiple times for different packages. The -p and -e options are mutually exclusive."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": "<_regex_>",
            "description": "Finds dependencies in packages matching the specified regular expression pattern. The -p and -e options are mutually exclusive."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Restricts 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 dependencies."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Finds class-level dependences in JDK internal APIs. By default, it analyzes all classes specified in the -classpath option and in input files unless you specified the -include option. You cannot use this option with the -p, -e, and -s options. Warning: JDK internal APIs may not be accessible in upcoming releases."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "Shows profile or the file containing a package."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Restricts 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."
        },
        {
            "flag": "-R",
            "long": null,
            "arg": null,
            "description": "Recursively traverses all dependencies."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Prints version information. -h, -?, -help Prints help message for jdeps."
        }
    ],
    "examples": [
        "Analyzing the dependencies of Notepad.jar.",
        "<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",
        "Use -P or -profile option to show on which profile that Notepad depends.",
        "<unnamed> (Notepad.jar)",
        "-> java.awt                                           Full JRE",
        "-> java.awt.event                                     Full JRE",
        "-> java.beans                                         Full JRE",
        "-> java.io                                            compact1",
        "-> java.lang                                          compact1",
        "-> java.net                                           compact1",
        "-> java.util                                          compact1",
        "-> java.util.logging                                  compact1",
        "-> javax.swing                                        Full JRE",
        "-> javax.swing.border                                 Full JRE",
        "-> javax.swing.event                                  Full JRE",
        "-> javax.swing.text                                   Full JRE",
        "-> javax.swing.tree                                   Full JRE",
        "-> javax.swing.undo                                   Full JRE",
        "Analyzing the immediate dependencies of a specific class in a given classpath, for example",
        "the com.sun.tools.jdeps.Main class in the tools.jar file.",
        "com.sun.tools.jdeps (tools.jar)",
        "-> java.io",
        "-> java.lang",
        "Use the -verbose:class option to find class-level dependencies or use the -v or -verbose",
        "option to include dependencies from the same JAR file.",
        "com.sun.tools.jdeps.Main (tools.jar)",
        "-> java.io.PrintWriter",
        "-> java.lang.Exception",
        "-> java.lang.Object",
        "-> java.lang.String",
        "-> java.lang.System",
        "Use the -R or -recursive option to analyze the transitive dependencies of the",
        "com.sun.tools.jdeps.Main class.",
        "com.sun.tools.classfile (tools.jar)",
        "-> java.io",
        "-> java.lang",
        "-> java.lang.reflect",
        "-> java.nio.charset",
        "-> java.nio.file",
        "-> java.util",
        "-> java.util.regex",
        "com.sun.tools.jdeps (tools.jar)",
        "-> java.io",
        "-> java.lang",
        "-> java.nio.file",
        "-> java.nio.file.attribute",
        "-> java.text",
        "-> java.util",
        "-> java.util.jar",
        "-> java.util.regex",
        "-> java.util.zip",
        "javax.crypto (jce.jar)",
        "-> java.io",
        "-> java.lang",
        "-> java.lang.reflect",
        "-> java.net",
        "-> java.nio",
        "-> java.security",
        "-> java.security.cert",
        "-> java.security.spec",
        "-> java.util",
        "-> java.util.concurrent",
        "-> java.util.jar",
        "-> java.util.regex",
        "-> java.util.zip",
        "-> javax.security.auth",
        "-> sun.security.jca                                   JDK internal API (rt.jar)",
        "-> sun.security.util                                  JDK internal API (rt.jar)",
        "javax.crypto.spec (jce.jar)",
        "-> java.lang",
        "-> java.security.spec",
        "-> java.util",
        "java.security (rt.jar)",
        "-> javax.crypto",
        "Generate dot files of the dependencies of Notepad demo.",
        "jdeps will create one dot file for each given JAR file named <filename>.dot in the dot",
        "directory specified in the -dotoutput option, and also a summary file named summary.dot that",
        "will list the dependencies among the JAR files",
        "// Path: demo/jfc/Notepad/Notepad.jar",
        "\"<unnamed>\"                                        -> \"java.awt\";",
        "\"<unnamed>\"                                        -> \"java.awt.event\";",
        "\"<unnamed>\"                                        -> \"java.beans\";",
        "\"<unnamed>\"                                        -> \"java.io\";",
        "\"<unnamed>\"                                        -> \"java.lang\";",
        "\"<unnamed>\"                                        -> \"java.net\";",
        "\"<unnamed>\"                                        -> \"java.util\";",
        "\"<unnamed>\"                                        -> \"java.util.logging\";",
        "\"<unnamed>\"                                        -> \"javax.swing\";",
        "\"<unnamed>\"                                        -> \"javax.swing.border\";",
        "\"<unnamed>\"                                        -> \"javax.swing.event\";",
        "\"<unnamed>\"                                        -> \"javax.swing.text\";",
        "\"<unnamed>\"                                        -> \"javax.swing.tree\";",
        "\"<unnamed>\"                                        -> \"javax.swing.undo\";",
        "\"Notepad.jar\"                  -> \"rt.jar\";"
    ],
    "see_also": [
        {
            "name": "javap",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/javap/1/json"
        }
    ]
}