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" "2020" "JDK 14" "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]\-?\f[R] or \f[CB]\-h\f[R] or \f[CB]\-\-help\f[R] 67 Prints the help message. 68 .RS 69 .RE 70 .TP 71 .B \f[CB]\-dotoutput\f[R] \f[I]dir\f[R] or \f[CB]\-\-dot\-output\f[R] \f[I]dir\f[R] 72 Specifies the destination directory for DOT file output. 73 If this option is specified, then the \f[CB]jdeps\f[R]command generates 74 one \f[CB]\&.dot\f[R] file for each analyzed archive named 75 \f[CB]archive\-file\-name.dot\f[R] that lists the dependencies, and also a 76 summary file named \f[CB]summary.dot\f[R] that lists the dependencies 77 among the archive files. 78 .RS 79 .RE 80 .TP 81 .B \f[CB]\-s\f[R] or \f[CB]\-summary\f[R] 82 Prints a dependency summary only. 83 .RS 84 .RE 85 .TP 86 .B \f[CB]\-v\f[R] or \f[CB]\-verbose\f[R] 87 Prints all class\-level dependencies. 88 This is equivalent to 89 .RS 90 .RS 91 .PP 92 \f[CB]\-verbose:class\ \-filter:none\f[R] 93 .RE 94 .RE 95 .TP 96 .B \f[CB]\-verbose:package\f[R] 97 Prints package\-level dependencies excluding, by default, dependences 98 within the same package. 99 .RS 100 .RE 101 .TP 102 .B \f[CB]\-verbose:class\f[R] 103 Prints class\-level dependencies excluding, by default, dependencies 104 within the same archive. 105 .RS 106 .RE 107 .TP 108 .B \f[CB]\-apionly\f[R] or \f[CB]\-\-api\-only\f[R] 109 Restricts the analysis to APIs, for example, dependences from the 110 signature of \f[CB]public\f[R] and \f[CB]protected\f[R] members of public 111 classes including field type, method parameter types, returned type, and 112 checked exception types. 113 .RS 114 .RE 115 .TP 116 .B \f[CB]\-jdkinternals\f[R] or \f[CB]\-\-jdk\-internals\f[R] 117 Finds class\-level dependences in the JDK internal APIs. 118 By default, this option analyzes all classes specified in the 119 \f[CB]\-\-classpath\f[R] option and input files unless you specified the 120 \f[CB]\-include\f[R] option. 121 You can\[aq]t use this option with the \f[CB]\-p\f[R], \f[CB]\-e\f[R], and 122 \f[CB]\-s\f[R] options. 123 .RS 124 .PP 125 \f[B]Warning\f[R]: The JDK internal APIs are inaccessible. 126 .RE 127 .TP 128 .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] 129 Specifies where to find class files. 130 .RS 131 .RE 132 .TP 133 .B \f[CB]\-\-module\-path\f[R] \f[I]module\-path\f[R] 134 Specifies the module path. 135 .RS 136 .RE 137 .TP 138 .B \f[CB]\-\-upgrade\-module\-path\f[R] \f[I]module\-path\f[R] 139 Specifies the upgrade module path. 140 .RS 141 .RE 142 .TP 143 .B \f[CB]\-\-system\f[R] \f[I]java\-home\f[R] 144 Specifies an alternate system module path. 145 .RS 146 .RE 147 .TP 148 .B \f[CB]\-\-add\-modules\f[R] \f[I]module\-name\f[R][\f[CB],\f[R] \f[I]module\-name\f[R]...] 149 Adds modules to the root set for analysis. 150 .RS 151 .RE 152 .TP 153 .B \f[CB]\-\-multi\-release\f[R] \f[I]version\f[R] 154 Specifies the version when processing multi\-release JAR files. 155 \f[I]version\f[R] should be an integer >=9 or base. 156 .RS 157 .RE 158 .TP 159 .B \f[CB]\-q\f[R] or \f[CB]\-quiet\f[R] 160 Doesn\[aq]t show missing dependencies from 161 \f[CB]\-generate\-module\-info\f[R] output. 162 .RS 163 .RE 164 .TP 165 .B \f[CB]\-version\f[R] or \f[CB]\-\-version\f[R] 166 Prints version information. 167 .RS 168 .RE 169 .SH MODULE DEPENDENCE ANALYSIS OPTIONS 170 .TP 171 .B \f[CB]\-m\f[R] \f[I]module\-name\f[R] or \f[CB]\-\-module\f[R] \f[I]module\-name\f[R] 172 Specifies the root module for analysis. 173 .RS 174 .RE 175 .TP 176 .B \f[CB]\-\-generate\-module\-info\f[R] \f[I]dir\f[R] 177 Generates \f[CB]module\-info.java\f[R] under the specified directory. 178 The specified JAR files will be analyzed. 179 This option cannot be used with \f[CB]\-\-dot\-output\f[R] or 180 \f[CB]\-\-class\-path\f[R] options. 181 Use the \f[CB]\-\-generate\-open\-module\f[R] option for open modules. 182 .RS 183 .RE 184 .TP 185 .B \f[CB]\-\-generate\-open\-module\f[R] \f[I]dir\f[R] 186 Generates \f[CB]module\-info.java\f[R] for the specified JAR files under 187 the specified directory as open modules. 188 This option cannot be used with the \f[CB]\-\-dot\-output\f[R] or 189 \f[CB]\-\-class\-path\f[R] options. 190 .RS 191 .RE 192 .TP 193 .B \f[CB]\-\-check\f[R] \f[I]module\-name\f[R] [\f[CB],\f[R] \f[I]module\-name\f[R]...] 194 Analyzes the dependence of the specified modules. 195 It prints the module descriptor, the resulting module dependences after 196 analysis and the graph after transition reduction. 197 It also identifies any unused qualified exports. 198 .RS 199 .RE 200 .TP 201 .B \f[CB]\-\-list\-deps\f[R] 202 Lists the module dependences and also the package names of JDK internal 203 APIs (if referenced). 204 This option transitively analyzes libraries on class path and module 205 path if referenced. 206 Use \f[CB]\-\-no\-recursive\f[R] option for non\-transitive dependency 207 analysis. 208 .RS 209 .RE 210 .TP 211 .B \f[CB]\-\-list\-reduced\-deps\f[R] 212 Same as \f[CB]\-\-list\-deps\f[R] without listing the implied reads edges 213 from the module graph. 214 If module M1 reads M2, and M2 requires transitive on M3, then M1 reading 215 M3 is implied and is not shown in the graph. 216 .RS 217 .RE 218 .TP 219 .B \f[CB]\-\-print\-module\-deps\f[R] 220 Same as \f[CB]\-\-list\-reduced\-deps\f[R] with printing a 221 comma\-separated list of module dependences. 222 The output can be used by \f[CB]jlink\ \-\-add\-modules\f[R] to create a 223 custom image that contains those modules and their transitive 224 dependences. 225 .RS 226 .RE 227 .TP 228 .B \f[CB]\-\-ignore\-missing\-deps\f[R] 229 Ignore missing dependences. 230 .RS 231 .RE 232 .SH OPTIONS TO FILTER DEPENDENCES 233 .TP 234 .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] 235 Finds dependences matching the specified package name. 236 You can specify this option multiple times for different packages. 237 The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive. 238 .RS 239 .RE 240 .TP 241 .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] 242 Finds dependences matching the specified pattern. 243 The \f[CB]\-p\f[R] and \f[CB]\-e\f[R] options are mutually exclusive. 244 .RS 245 .RE 246 .TP 247 .B \f[CB]\-\-require\f[R] \f[I]module\-name\f[R] 248 Finds dependences matching the given module name (may be given multiple 249 times). 250 The \f[CB]\-\-package\f[R], \f[CB]\-\-regex\f[R], and \f[CB]\-\-require\f[R] 251 options are mutually exclusive. 252 .RS 253 .RE 254 .TP 255 .B \f[CB]\-f\f[R] \f[I]regex\f[R] or \f[CB]\-filter\f[R] \f[I]regex\f[R] 256 Filters dependences matching the given pattern. 257 If give multiple times, the last one will be selected. 258 .RS 259 .RE 260 .TP 261 .B \f[CB]\-filter:package\f[R] 262 Filters dependences within the same package. 263 This is the default. 264 .RS 265 .RE 266 .TP 267 .B \f[CB]\-filter:archive\f[R] 268 Filters dependences within the same archive. 269 .RS 270 .RE 271 .TP 272 .B \f[CB]\-filter:module\f[R] 273 Filters dependences within the same module. 274 .RS 275 .RE 276 .TP 277 .B \f[CB]\-filter:none\f[R] 278 No \f[CB]\-filter:package\f[R] and \f[CB]\-filter:archive\f[R] filtering. 279 Filtering specified via the \f[CB]\-filter\f[R] option still applies. 280 .RS 281 .RE 282 .TP 283 .B \f[CB]\-\-missing\-deps\f[R] 284 Finds missing dependences. 285 This option cannot be used with \f[CB]\-p\f[R], \f[CB]\-e\f[R] and 286 \f[CB]\-s\f[R] options. 287 .RS 288 .RE 289 .SH OPTIONS TO FILTER CLASSES TO BE ANALYZED 290 .TP 291 .B \f[CB]\-include\f[R] \f[I]regex\f[R] 292 Restricts analysis to the classes matching pattern. 293 This option filters the list of classes to be analyzed. 294 It can be used together with \f[CB]\-p\f[R] and \f[CB]\-e\f[R], which apply 295 the pattern to the dependencies. 296 .RS 297 .RE 298 .TP 299 .B \f[CB]\-P\f[R] or \f[CB]\-profile\f[R] 300 Shows the profile containing a package. 301 .RS 302 .RE 303 .TP 304 .B \f[CB]\-R\f[R] or \f[CB]\-\-recursive\f[R] 305 Recursively traverses all run\-time dependences. 306 The \f[CB]\-R\f[R] option implies \f[CB]\-filter:none\f[R]. 307 If \f[CB]\-p\f[R], \f[CB]\-e\f[R], or \f[CB]\-f\f[R] options are specified, 308 only the matching dependences are analyzed. 309 .RS 310 .RE 311 .TP 312 .B \f[CB]\-\-no\-recursive\f[R] 313 Do not recursively traverse dependences. 314 .RS 315 .RE 316 .TP 317 .B \f[CB]\-I\f[R] or \f[CB]\-\-inverse\f[R] 318 Analyzes the dependences per other given options and then finds all 319 artifacts that directly and indirectly depend on the matching nodes. 320 This is equivalent to the inverse of the compile\-time view analysis and 321 the print dependency summary. 322 This option must be used with the \f[CB]\-\-require\f[R], 323 \f[CB]\-\-package\f[R], or \f[CB]\-\-regex\f[R] options. 324 .RS 325 .RE 326 .TP 327 .B \f[CB]\-\-compile\-time\f[R] 328 Analyzes the compile\-time view of transitive dependencies, such as the 329 compile\-time view of the \f[CB]\-R\f[R] option. 330 Analyzes the dependences per other specified options. 331 If a dependency is found from a directory, a JAR file or a module, all 332 classes in that containing archive are analyzed. 333 .RS 334 .RE 335 .SH EXAMPLE OF ANALYZING DEPENDENCIES 336 .PP 337 The following example demonstrates analyzing the dependencies of the 338 \f[CB]Notepad.jar\f[R] file. 339 .PP 340 \f[B]Oracle Solaris, Linux, and OS X:\f[R] 341 .IP 342 .nf 343 \f[CB] 344 $\ jdeps\ demo/jfc/Notepad/Notepad.jar 345 Notepad.jar\ \->\ java.base 346 Notepad.jar\ \->\ java.desktop 347 Notepad.jar\ \->\ java.logging 348 \ \ \ <unnamed>\ (Notepad.jar) 349 \ \ \ \ \ \ \->\ java.awt 350 \ \ \ \ \ \ \->\ java.awt.event 351 \ \ \ \ \ \ \->\ java.beans 352 \ \ \ \ \ \ \->\ java.io 353 \ \ \ \ \ \ \->\ java.lang 354 \ \ \ \ \ \ \->\ java.net 355 \ \ \ \ \ \ \->\ java.util 356 \ \ \ \ \ \ \->\ java.util.logging 357 \ \ \ \ \ \ \->\ javax.swing 358 \ \ \ \ \ \ \->\ javax.swing.border 359 \ \ \ \ \ \ \->\ javax.swing.event 360 \ \ \ \ \ \ \->\ javax.swing.text 361 \ \ \ \ \ \ \->\ javax.swing.tree 362 \ \ \ \ \ \ \->\ javax.swing.undo 363 \f[R] 364 .fi 365 .PP 366 \f[B]Windows:\f[R] 367 .IP 368 .nf 369 \f[CB] 370 C:\\Java\\jdk1.9.0>jdeps\ demo\\jfc\\Notepad\\Notepad.jar 371 Notepad.jar\ \->\ java.base 372 Notepad.jar\ \->\ java.desktop 373 Notepad.jar\ \->\ java.logging 374 \ \ \ <unnamed>\ (Notepad.jar) 375 \ \ \ \ \ \ \->\ java.awt 376 \ \ \ \ \ \ \->\ java.awt.event 377 \ \ \ \ \ \ \->\ java.beans 378 \ \ \ \ \ \ \->\ java.io 379 \ \ \ \ \ \ \->\ java.lang 380 \ \ \ \ \ \ \->\ java.net 381 \ \ \ \ \ \ \->\ java.util 382 \ \ \ \ \ \ \->\ java.util.logging 383 \ \ \ \ \ \ \->\ javax.swing 384 \ \ \ \ \ \ \->\ javax.swing.border 385 \ \ \ \ \ \ \->\ javax.swing.event 386 \ \ \ \ \ \ \->\ javax.swing.text 387 \ \ \ \ \ \ \->\ javax.swing.tree 388 \ \ \ \ \ \ \->\ javax.swing.undo 389 \f[R] 390 .fi 391 .SH EXAMPLE USING THE \-\-INVERSE OPTION 392 .IP 393 .nf 394 \f[CB] 395 \ $\ jdeps\ \-\-inverse\ \-\-require\ java.xml.bind 396 Inverse\ transitive\ dependences\ on\ [java.xml.bind] 397 java.xml.bind\ <\-\ java.se.ee 398 java.xml.bind\ <\-\ jdk.xml.ws 399 java.xml.bind\ <\-\ java.xml.ws\ <\-\ java.se.ee 400 java.xml.bind\ <\-\ java.xml.ws\ <\-\ jdk.xml.ws 401 java.xml.bind\ <\-\ jdk.xml.bind\ <\-\ jdk.xml.ws 402 \f[R] 403 .fi