1 .\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
   2 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3 .\"
   4 .\" This code is free software; you can redistribute it and/or modify it
   5 .\" under the terms of the GNU General Public License version 2 only, as
   6 .\" published by the Free Software Foundation.
   7 .\"
   8 .\" This code is distributed in the hope that it will be useful, but WITHOUT
   9 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11 .\" version 2 for more details (a copy is included in the LICENSE file that
  12 .\" accompanied this code).
  13 .\"
  14 .\" You should have received a copy of the GNU General Public License version
  15 .\" 2 along with this work; if not, write to the Free Software Foundation,
  16 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 .\"
  18 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 .\" or visit www.oracle.com if you need additional information or have any
  20 .\" questions.
  21 .\"
  22 .\" Automatically generated by Pandoc 2.3.1
  23 .\"
  24 .TH "JDEPS" "1" "2018" "JDK 13" "JDK Commands"
  25 .hy
  26 .SH NAME
  27 .PP
  28 jdeps \- launch the Java class dependency analyzer
  29 .SH SYNOPSIS
  30 .PP
  31 \f[CB]jdeps\f[R] [\f[I]options\f[R]] \f[I]path\f[R] ...
  32 .TP
  33 .B \f[I]options\f[R]
  34 Command\-line options.
  35 For detailed descriptions of the options that can be used, see
  36 .RS
  37 .IP \[bu] 2
  38 \f[B]Possible Options\f[R]
  39 .IP \[bu] 2
  40 \f[B]Module Dependence Analysis Options\f[R]
  41 .IP \[bu] 2
  42 \f[B]Options to Filter Dependences\f[R]
  43 .IP \[bu] 2
  44 \f[B]Options to Filter Classes to be Analyzed\f[R]
  45 .RE
  46 .TP
  47 .B \f[I]path\f[R]
  48 A pathname to the \f[CB]\&.class\f[R] file, directory, or JAR file to
  49 analyze.
  50 .RS
  51 .RE
  52 .SH DESCRIPTION
  53 .PP
  54 The \f[CB]jdeps\f[R] command shows the package\-level or class\-level
  55 dependencies of Java class files.
  56 The input class can be a path name to a \f[CB]\&.class\f[R] file, a
  57 directory, a JAR file, or it can be a fully qualified class name to
  58 analyze all class files.
  59 The options determine the output.
  60 By default, the \f[CB]jdeps\f[R] command writes the dependencies to the
  61 system output.
  62 The command can generate the dependencies in DOT language (see the
  63 \f[CB]\-dotoutput\f[R] option).
  64 .SH POSSIBLE OPTIONS
  65 .TP
  66 .B \f[CB]\-dotoutput\f[R] \f[I]dir\f[R] or \f[CB]\-\-dot\-output\f[R] \f[I]dir\f[R]
  67 Specifies the destination directory for DOT file output.
  68 If this option is specified, then the \f[CB]jdeps\f[R]command generates
  69 one \f[CB]\&.dot\f[R] file for each analyzed archive named
  70 \f[CB]archive\-file\-name.dot\f[R] that lists the dependencies, and also a
  71 summary file named \f[CB]summary.dot\f[R] that lists the dependencies
  72 among the archive files.
  73 .RS
  74 .RE
  75 .TP
  76 .B \f[CB]\-s\f[R] or \f[CB]\-summary\f[R]
  77 Prints a dependency summary only.
  78 .RS
  79 .RE
  80 .TP
  81 .B \f[CB]\-v\f[R] or \f[CB]\-verbose\f[R]
  82 Prints all class\-level dependencies.
  83 This is equivalent to
  84 .RS
  85 .RS
  86 .PP
  87 \f[CB]\-verbose:class\ \-filter:none\f[R]
  88 .RE
  89 .RE
  90 .TP
  91 .B \f[CB]\-verbose:package\f[R]
  92 Prints package\-level dependencies excluding, by default, dependences
  93 within the same package.
  94 .RS
  95 .RE
  96 .TP
  97 .B \f[CB]\-verbose:class\f[R]
  98 Prints class\-level dependencies excluding, by default, dependencies
  99 within the same archive.
 100 .RS
 101 .RE
 102 .TP
 103 .B \f[CB]\-apionly\f[R] or \f[CB]\-\-api\-only\f[R]
 104 Restricts the analysis to APIs, for example, dependences from the
 105 signature of \f[CB]public\f[R] and \f[CB]protected\f[R] members of public
 106 classes including field type, method parameter types, returned type, and
 107 checked exception types.
 108 .RS
 109 .RE
 110 .TP
 111 .B \f[CB]\-jdkinternals\f[R] or \f[CB]\-\-jdk\-internals\f[R]
 112 Finds class\-level dependences in the JDK internal APIs.
 113 By default, this option analyzes all classes specified in the
 114 \f[CB]\-\-classpath\f[R] option and input files unless you specified the
 115 \f[CB]\-include\f[R] option.
 116 You can\[aq]t use this option with the \f[CB]\-p\f[R], \f[CB]\-e\f[R], and
 117 \f[CB]\-s\f[R] options.
 118 .RS
 119 .PP
 120 \f[B]Warning\f[R]: The JDK internal APIs are inaccessible.
 121 .RE
 122 .TP
 123 .B \f[CB]\-cp\f[R] \f[I]path\f[R], \f[CB]\-classpath\f[R] \f[I]path\f[R], or \f[CB]\-\-class\-path\f[R] \f[I]path\f[R]
 124 Specifies where to find class files.
 125 .RS
 126 .RE
 127 .TP
 128 .B \f[CB]\-\-module\-path\f[R] \f[I]module\-path\f[R]
 129 Specifies the module path.
 130 .RS
 131 .RE
 132 .TP
 133 .B \f[CB]\-\-upgrade\-module\-path\f[R] \f[I]module\-path\f[R]
 134 Specifies the upgrade module path.
 135 .RS
 136 .RE
 137 .TP
 138 .B \f[CB]\-\-system\f[R] \f[I]java\-home\f[R]
 139 Specifies an alternate system module path.
 140 .RS
 141 .RE
 142 .TP
 143 .B \f[CB]\-\-add\-modules\f[R] \f[I]module\-name\f[R][\f[CB],\f[R] \f[I]module\-name\f[R]...]
 144 Adds modules to the root set for analysis.
 145 .RS
 146 .RE
 147 .TP
 148 .B \f[CB]\-\-multi\-release\f[R] \f[I]version\f[R]
 149 Specifies the version when processing multi\-release JAR files.
 150 \f[I]version\f[R] should be an integer >=9 or base.
 151 .RS
 152 .RE
 153 .TP
 154 .B \f[CB]\-q\f[R] or \f[CB]\-quiet\f[R]
 155 Doesn\[aq]t show missing dependencies from
 156 \f[CB]\-generate\-module\-info\f[R] output.
 157 .RS
 158 .RE
 159 .TP
 160 .B \f[CB]\-version\f[R] or \f[CB]\-\-version\f[R]
 161 Prints version information.
 162 .RS
 163 .RE
 164 .SH MODULE DEPENDENCE ANALYSIS OPTIONS
 165 .TP
 166 .B \f[CB]\-m\f[R] \f[I]module\-name\f[R] or \f[CB]\-\-module\f[R] \f[I]module\-name\f[R]
 167 Specifies the root module for analysis.
 168 .RS
 169 .RE
 170 .TP
 171 .B \f[CB]\-\-generate\-module\-info\f[R] \f[I]dir\f[R]
 172 Generates \f[CB]module\-info.java\f[R] under the specified directory.
 173 The specified JAR files will be analyzed.
 174 This option cannot be used with \f[CB]\-\-dot\-output\f[R] or
 175 \f[CB]\-\-class\-path\f[R] options.
 176 Use the \f[CB]\-\-generate\-open\-module\f[R] option for open modules.
 177 .RS
 178 .RE
 179 .TP
 180 .B \f[CB]\-\-generate\-open\-module\f[R] \f[I]dir\f[R]
 181 Generates \f[CB]module\-info.java\f[R] for the specified JAR files under
 182 the specified directory as open modules.
 183 This option cannot be used with the \f[CB]\-\-dot\-output\f[R] or
 184 \f[CB]\-\-class\-path\f[R] options.
 185 .RS
 186 .RE
 187 .TP
 188 .B \f[CB]\-\-check\f[R] \f[I]module\-name\f[R] [\f[CB],\f[R] \f[I]module\-name\f[R]...]
 189 Analyzes the dependence of the specified modules.
 190 It prints the module descriptor, the resulting module dependences after
 191 analysis and the graph after transition reduction.
 192 It also identifies any unused qualified exports.
 193 .RS
 194 .RE
 195 .TP
 196 .B \f[CB]\-\-list\-deps\f[R]
 197 Lists the module dependences and also the package names of JDK internal
 198 APIs (if referenced).
 199 This option transitively analyzes libraries on class path and module
 200 path if referenced.
 201 Use \f[CB]\-\-no\-recursive\f[R] option for non\-transitive dependency
 202 analysis.
 203 .RS
 204 .RE
 205 .TP
 206 .B \f[CB]\-\-list\-reduced\-deps\f[R]
 207 Same as \f[CB]\-\-list\-deps\f[R] without listing the implied reads edges
 208 from the module graph.
 209 If module M1 reads M2, and M2 requires transitive on M3, then M1 reading
 210 M3 is implied and is not shown in the graph.
 211 .RS
 212 .RE
 213 .TP
 214 .B \f[CB]\-\-print\-module\-deps\f[R]
 215 Same as \f[CB]\-\-list\-reduced\-deps\f[R] with printing a
 216 comma\-separated list of module dependences.
 217 The output can be used by \f[CB]jlink\ \-\-add\-modules\f[R] to create a
 218 custom image that contains those modules and their transitive
 219 dependences.
 220 .RS
 221 .RE
 222 .TP
 223 .B \f[CB]\-\-ignore\-missing\-deps\f[R]
 224 Ignore missing dependences.
 225 .RS
 226 .RE
 227 .SH OPTIONS TO FILTER DEPENDENCES
 228 .TP
 229 .B \f[CB]\-p\f[R] \f[I]pkg_name\f[R], \f[CB]\-package\f[R] \f[I]pkg_name\f[R], or \f[CB]\-\-package\f[R] \f[I]pkg_name\f[R]
 230 Finds dependences matching the specified package name.
 231 You can specify this option multiple times for different packages.
 232 The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive.
 233 .RS
 234 .RE
 235 .TP
 236 .B \f[CB]\-e\f[R] \f[I]regex\f[R], \f[CB]\-regex\f[R] \f[I]regex\f[R], or \f[CB]\-\-regex\f[R] \f[I]regex\f[R]
 237 Finds dependences matching the specified pattern.
 238 The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive.
 239 .RS
 240 .RE
 241 .TP
 242 .B \f[CB]\-\-require\f[R] \f[I]module\-name\f[R]
 243 Finds dependences matching the given module name (may be given multiple
 244 times).
 245 The \f[CB]\-\-package\f[R], \f[CB]\-\-regex\f[R], and \f[CB]\-\-require\f[R]
 246 options are mutually exclusive.
 247 .RS
 248 .RE
 249 .TP
 250 .B \f[CB]\-f\f[R] \f[I]regex\f[R] or \f[CB]\-filter\f[R] \f[I]regex\f[R]
 251 Filters dependences matching the given pattern.
 252 If give multiple times, the last one will be selected.
 253 .RS
 254 .RE
 255 .TP
 256 .B \f[CB]\-filter:package\f[R]
 257 Filters dependences within the same package.
 258 This is the default.
 259 .RS
 260 .RE
 261 .TP
 262 .B \f[CB]\-filter:archive\f[R]
 263 Filters dependences within the same archive.
 264 .RS
 265 .RE
 266 .TP
 267 .B \f[CB]\-filter:module\f[R]
 268 Filters dependences within the same module.
 269 .RS
 270 .RE
 271 .TP
 272 .B \f[CB]\-filter:none\f[R]
 273 No \f[CB]\-filter:package\f[R] and \f[CB]\-filter:archive\f[R] filtering.
 274 Filtering specified via the \f[CB]\-filter\f[R] option still applies.
 275 .RS
 276 .RE
 277 .TP
 278 .B \f[CB]\-\-missing\-deps\f[R]
 279 Finds missing dependences.
 280 This option cannot be used with \f[CB]\-p\f[R], \f[CB]\-e\f[R] and
 281 \f[CB]\-s\f[R] options.
 282 .RS
 283 .RE
 284 .SH OPTIONS TO FILTER CLASSES TO BE ANALYZED
 285 .TP
 286 .B \f[CB]\-include\f[R] \f[I]regex\f[R]
 287 Restricts analysis to the classes matching pattern.
 288 This option filters the list of classes to be analyzed.
 289 It can be used together with \f[CB]\-p\f[R] and \f[CB]\-e\f[R], which apply
 290 the pattern to the dependencies.
 291 .RS
 292 .RE
 293 .TP
 294 .B \f[CB]\-P\f[R] or \f[CB]\-profile\f[R]
 295 Shows the profile containing a package.
 296 .RS
 297 .RE
 298 .TP
 299 .B \f[CB]\-R\f[R] or \f[CB]\-recursive\f[R]
 300 Recursively traverses all run\-time dependences.
 301 The \f[CB]\-R\f[R] option implies \f[CB]\-filter:none\f[R].
 302 If \f[CB]\-p\f[R], \f[CB]\-e\f[R], or \f[CB]\-f\f[R] options are specified,
 303 only the matching dependences are analyzed.
 304 .RS
 305 .RE
 306 .TP
 307 .B \f[CB]\-\-no\-recursive\f[R]
 308 Do not recursively traverse dependences.
 309 .RS
 310 .RE
 311 .TP
 312 .B \f[CB]\-I\f[R] or \f[CB]\-inverse\f[R]
 313 Analyzes the dependences per other given options and then finds all
 314 artifacts that directly and indirectly depend on the matching nodes.
 315 This is equivalent to the inverse of the compile\-time view analysis and
 316 the print dependency summary.
 317 This option must be used with the \f[CB]\-\-require\f[R],
 318 \f[CB]\-\-package\f[R], or \f[CB]\-\-regex\f[R] options.
 319 .RS
 320 .RE
 321 .TP
 322 .B \f[CB]\-\-compile\-time\f[R]
 323 Analyzes the compile\-time view of transitive dependencies, such as the
 324 compile\-time view of the \f[CB]\-R\f[R] option.
 325 Analyzes the dependences per other specified options.
 326 If a dependency is found from a directory, a JAR file or a module, all
 327 classes in that containing archive are analyzed.
 328 .RS
 329 .RE
 330 .SH EXAMPLE OF ANALYZING DEPENDENCIES
 331 .PP
 332 The following example demonstrates analyzing the dependencies of the
 333 \f[CB]Notepad.jar\f[R] file.
 334 .PP
 335 \f[B]Oracle Solaris, Linux, and OS X:\f[R]
 336 .IP
 337 .nf
 338 \f[CB]
 339 $\ jdeps\ demo/jfc/Notepad/Notepad.jar
 340 Notepad.jar\ \->\ java.base
 341 Notepad.jar\ \->\ java.desktop
 342 Notepad.jar\ \->\ java.logging
 343 \ \ \ <unnamed>\ (Notepad.jar)
 344 \ \ \ \ \ \ \->\ java.awt
 345 \ \ \ \ \ \ \->\ java.awt.event
 346 \ \ \ \ \ \ \->\ java.beans
 347 \ \ \ \ \ \ \->\ java.io
 348 \ \ \ \ \ \ \->\ java.lang
 349 \ \ \ \ \ \ \->\ java.net
 350 \ \ \ \ \ \ \->\ java.util
 351 \ \ \ \ \ \ \->\ java.util.logging
 352 \ \ \ \ \ \ \->\ javax.swing
 353 \ \ \ \ \ \ \->\ javax.swing.border
 354 \ \ \ \ \ \ \->\ javax.swing.event
 355 \ \ \ \ \ \ \->\ javax.swing.text
 356 \ \ \ \ \ \ \->\ javax.swing.tree
 357 \ \ \ \ \ \ \->\ javax.swing.undo
 358 \f[R]
 359 .fi
 360 .PP
 361 \f[B]Windows:\f[R]
 362 .IP
 363 .nf
 364 \f[CB]
 365 C:\\Java\\jdk1.9.0>jdeps\ demo\\jfc\\Notepad\\Notepad.jar
 366 Notepad.jar\ \->\ java.base
 367 Notepad.jar\ \->\ java.desktop
 368 Notepad.jar\ \->\ java.logging
 369 \ \ \ <unnamed>\ (Notepad.jar)
 370 \ \ \ \ \ \ \->\ java.awt
 371 \ \ \ \ \ \ \->\ java.awt.event
 372 \ \ \ \ \ \ \->\ java.beans
 373 \ \ \ \ \ \ \->\ java.io
 374 \ \ \ \ \ \ \->\ java.lang
 375 \ \ \ \ \ \ \->\ java.net
 376 \ \ \ \ \ \ \->\ java.util
 377 \ \ \ \ \ \ \->\ java.util.logging
 378 \ \ \ \ \ \ \->\ javax.swing
 379 \ \ \ \ \ \ \->\ javax.swing.border
 380 \ \ \ \ \ \ \->\ javax.swing.event
 381 \ \ \ \ \ \ \->\ javax.swing.text
 382 \ \ \ \ \ \ \->\ javax.swing.tree
 383 \ \ \ \ \ \ \->\ javax.swing.undo
 384 \f[R]
 385 .fi
 386 .SH EXAMPLE USING THE \-\-INVERSE OPTION
 387 .IP
 388 .nf
 389 \f[CB]
 390 \ $\ jdeps\ \-\-inverse\ \-\-require\ java.xml.bind
 391 Inverse\ transitive\ dependences\ on\ [java.xml.bind]
 392 java.xml.bind\ <\-\ java.se.ee
 393 java.xml.bind\ <\-\ jdk.xml.ws
 394 java.xml.bind\ <\-\ java.xml.ws\ <\-\ java.se.ee
 395 java.xml.bind\ <\-\ java.xml.ws\ <\-\ jdk.xml.ws
 396 java.xml.bind\ <\-\ jdk.xml.bind\ <\-\ jdk.xml.ws
 397 \f[R]
 398 .fi