1 '\" t
   2 .\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 .\"
   5 .\" This code is free software; you can redistribute it and/or modify it
   6 .\" under the terms of the GNU General Public License version 2 only, as
   7 .\" published by the Free Software Foundation.
   8 .\"
   9 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 .\" version 2 for more details (a copy is included in the LICENSE file that
  13 .\" accompanied this code).
  14 .\"
  15 .\" You should have received a copy of the GNU General Public License version
  16 .\" 2 along with this work; if not, write to the Free Software Foundation,
  17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 .\"
  19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 .\" or visit www.oracle.com if you need additional information or have any
  21 .\" questions.
  22 .\"
  23 .\"     Arch: generic
  24 .\"     Software: JDK 8
  25 .\"     Date: 21 November 2013
  26 .\"     SectDesc: Basic Tools
  27 .\"     Title: jdeps.1
  28 .\"
  29 .if n .pl 99999
  30 .TH jdeps 1 "21 November 2013" "JDK 8" "Basic Tools"
  31 .\" -----------------------------------------------------------------
  32 .\" * Define some portability stuff
  33 .\" -----------------------------------------------------------------
  34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35 .\" http://bugs.debian.org/507673
  36 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38 .ie \n(.g .ds Aq \(aq
  39 .el       .ds Aq '
  40 .\" -----------------------------------------------------------------
  41 .\" * set default formatting
  42 .\" -----------------------------------------------------------------
  43 .\" disable hyphenation
  44 .nh
  45 .\" disable justification (adjust text to left margin only)
  46 .ad l
  47 .\" -----------------------------------------------------------------
  48 .\" * MAIN CONTENT STARTS HERE *
  49 .\" -----------------------------------------------------------------
  50 
  51 .SH NAME    
  52 jdeps \- Java class dependency analyzer\&.
  53 .SH SYNOPSIS    
  54 .sp     
  55 .nf     
  56 
  57 \fBjdeps\fR [\fIoptions\fR] \fIclasses\fR \&.\&.\&.
  58 .fi     
  59 .sp     
  60 .TP     
  61 \fIoptions\fR
  62 Command-line options\&. See Options\&.
  63 .TP     
  64 \fIclasses\fR
  65 Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
  66 .SH DESCRIPTION    
  67 The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR 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, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
  68 .SH OPTIONS    
  69 .TP
  70 -dotoutput <\fIdir\fR>
  71 .br
  72 Destination directory for DOT file output\&. If specified, \f3jdeps\fR will generate one dot file per each analyzed archive named <\fIarchive-file-name\fR>\&.dot listing the dependencies, and also a summary file named summary\&.dot listing the dependencies among the archives\&.
  73 .TP
  74 -s, -summary
  75 .br
  76 Prints dependency summary only\&.
  77 .TP
  78 -v, -verbose
  79 .br
  80 Prints all class-level dependencies\&.
  81 .TP
  82 -verbose:package
  83 .br
  84 Prints package-level dependencies excluding dependencies within the same archive\&.
  85 .TP
  86 -verbose:class
  87 .br
  88 Prints class-level dependencies excluding dependencies within the same archive\&.
  89 .TP
  90 -cp <\fIpath\fR>, -classpath <\fIpath\fR>
  91 .br
  92 Specifies where to find class files\&.
  93 
  94 See also Setting the Class Path\&.
  95 .TP
  96 -p <\fIpkg name\fR>, -package <\fIpkg name\fR>
  97 .br
  98 Finds dependencies in the specified package\&. You can specify this option multiple times for different packages\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
  99 .TP
 100 -e <\fIregex\fR>, -regex <\fIregex\fR>
 101 .br
 102 Finds dependencies in packages matching the specified regular expression pattern\&. The \f3-p\fR and \f3-e\fR options are mutually exclusive\&.
 103 .TP
 104 -include <\fIregex\fR>
 105 .br
 106 Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
 107 .TP
 108 -jdkinternals
 109 .br
 110 Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
 111 
 112 \fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
 113 .TP
 114 -P, -profile
 115 .br
 116 Shows profile or the file containing a package\&.
 117 .TP
 118 -apionly
 119 .br
 120 Restricts analysis to APIs, for example, dependences from the signature of \f3public\fR and \f3protected\fR members of public classes including field type, method parameter types, returned type, and checked exception types\&.
 121 .TP
 122 -R, -recursive
 123 .br
 124 Recursively traverses all dependencies\&.
 125 .TP
 126 -version
 127 .br
 128 Prints version information\&.
 129 .TP
 130 -h, -?, -help
 131 .br
 132 Prints help message for \f3jdeps\fR\&.
 133 .SH EXAMPLES    
 134 Analyzing the dependencies of Notepad\&.jar\&.
 135 .sp     
 136 .nf     
 137 \f3$ jdeps demo/jfc/Notepad/Notepad\&.jar\fP
 138 .fi     
 139 .nf     
 140 \f3\fP
 141 .fi     
 142 .nf     
 143 \f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
 144 .fi     
 145 .nf     
 146 \f3   <unnamed> (Notepad\&.jar)\fP
 147 .fi     
 148 .nf     
 149 \f3      \-> java\&.awt                                           \fP
 150 .fi     
 151 .nf     
 152 \f3      \-> java\&.awt\&.event                                     \fP
 153 .fi     
 154 .nf     
 155 \f3      \-> java\&.beans                                         \fP
 156 .fi     
 157 .nf     
 158 \f3      \-> java\&.io                                            \fP
 159 .fi     
 160 .nf     
 161 \f3      \-> java\&.lang                                          \fP
 162 .fi     
 163 .nf     
 164 \f3      \-> java\&.net                                           \fP
 165 .fi     
 166 .nf     
 167 \f3      \-> java\&.util                                          \fP
 168 .fi     
 169 .nf     
 170 \f3      \-> java\&.util\&.logging                                  \fP
 171 .fi     
 172 .nf     
 173 \f3      \-> javax\&.swing                                        \fP
 174 .fi     
 175 .nf     
 176 \f3      \-> javax\&.swing\&.border                                 \fP
 177 .fi     
 178 .nf     
 179 \f3      \-> javax\&.swing\&.event                                  \fP
 180 .fi     
 181 .nf     
 182 \f3      \-> javax\&.swing\&.text                                   \fP
 183 .fi     
 184 .nf     
 185 \f3      \-> javax\&.swing\&.tree                                   \fP
 186 .fi     
 187 .nf     
 188 \f3      \-> javax\&.swing\&.undo  \fP
 189 .fi     
 190 .nf     
 191 \f3\fP
 192 .fi     
 193 .sp     
 194 Use -P or -profile option to show on which profile that Notepad depends\&.
 195 .sp     
 196 .nf     
 197 \f3$ jdeps \-profile demo/jfc/Notepad/Notepad\&.jar \fP
 198 .fi     
 199 .nf     
 200 \f3demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE)\fP
 201 .fi     
 202 .nf     
 203 \f3   <unnamed> (Notepad\&.jar)\fP
 204 .fi     
 205 .nf     
 206 \f3      \-> java\&.awt                                           Full JRE\fP
 207 .fi     
 208 .nf     
 209 \f3      \-> java\&.awt\&.event                                     Full JRE\fP
 210 .fi     
 211 .nf     
 212 \f3      \-> java\&.beans                                         Full JRE\fP
 213 .fi     
 214 .nf     
 215 \f3      \-> java\&.io                                            compact1\fP
 216 .fi     
 217 .nf     
 218 \f3      \-> java\&.lang                                          compact1\fP
 219 .fi     
 220 .nf     
 221 \f3      \-> java\&.net                                           compact1\fP
 222 .fi     
 223 .nf     
 224 \f3      \-> java\&.util                                          compact1\fP
 225 .fi     
 226 .nf     
 227 \f3      \-> java\&.util\&.logging                                  compact1\fP
 228 .fi     
 229 .nf     
 230 \f3      \-> javax\&.swing                                        Full JRE\fP
 231 .fi     
 232 .nf     
 233 \f3      \-> javax\&.swing\&.border                                 Full JRE\fP
 234 .fi     
 235 .nf     
 236 \f3      \-> javax\&.swing\&.event                                  Full JRE\fP
 237 .fi     
 238 .nf     
 239 \f3      \-> javax\&.swing\&.text                                   Full JRE\fP
 240 .fi     
 241 .nf     
 242 \f3      \-> javax\&.swing\&.tree                                   Full JRE\fP
 243 .fi     
 244 .nf     
 245 \f3      \-> javax\&.swing\&.undo                                   Full JRE\fP
 246 .fi     
 247 .nf     
 248 \f3\fP
 249 .fi     
 250 .sp     
 251 Analyzing the immediate dependencies of a specific class in a given classpath, for example the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class in the tools\&.jar file\&.
 252 .sp     
 253 .nf     
 254 \f3$ jdeps \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
 255 .fi     
 256 .nf     
 257 \f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
 258 .fi     
 259 .nf     
 260 \f3   com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
 261 .fi     
 262 .nf     
 263 \f3      \-> java\&.io                                            \fP
 264 .fi     
 265 .nf     
 266 \f3      \-> java\&.lang \fP
 267 .fi     
 268 .nf     
 269 \f3\fP
 270 .fi     
 271 .sp     
 272 Use the \f3-verbose:class\fR option to find class-level dependencies or use the \f3-v\fR or \f3-verbose\fR option to include dependencies from the same JAR file\&.
 273 .sp     
 274 .nf     
 275 \f3$ jdeps \-verbose:class \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
 276 .fi     
 277 .nf     
 278 \f3\fP
 279 .fi     
 280 .nf     
 281 \f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
 282 .fi     
 283 .nf     
 284 \f3   com\&.sun\&.tools\&.jdeps\&.Main (tools\&.jar)\fP
 285 .fi     
 286 .nf     
 287 \f3      \-> java\&.io\&.PrintWriter                                \fP
 288 .fi     
 289 .nf     
 290 \f3      \-> java\&.lang\&.Exception                                \fP
 291 .fi     
 292 .nf     
 293 \f3      \-> java\&.lang\&.Object                                   \fP
 294 .fi     
 295 .nf     
 296 \f3      \-> java\&.lang\&.String                                   \fP
 297 .fi     
 298 .nf     
 299 \f3      \-> java\&.lang\&.System \fP
 300 .fi     
 301 .nf     
 302 \f3\fP
 303 .fi     
 304 .sp     
 305 Use the \f3-R\fR or \f3-recursive\fR option to analyze the transitive dependencies of the \f3com\&.sun\&.tools\&.jdeps\&.Main\fR class\&.
 306 .sp     
 307 .nf     
 308 \f3$ jdeps \-R \-cp lib/tools\&.jar com\&.sun\&.tools\&.jdeps\&.Main\fP
 309 .fi     
 310 .nf     
 311 \f3lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
 312 .fi     
 313 .nf     
 314 \f3   com\&.sun\&.tools\&.classfile (tools\&.jar)\fP
 315 .fi     
 316 .nf     
 317 \f3      \-> java\&.io                                            \fP
 318 .fi     
 319 .nf     
 320 \f3      \-> java\&.lang                                          \fP
 321 .fi     
 322 .nf     
 323 \f3      \-> java\&.lang\&.reflect                                  \fP
 324 .fi     
 325 .nf     
 326 \f3      \-> java\&.nio\&.charset                                   \fP
 327 .fi     
 328 .nf     
 329 \f3      \-> java\&.nio\&.file                                      \fP
 330 .fi     
 331 .nf     
 332 \f3      \-> java\&.util                                          \fP
 333 .fi     
 334 .nf     
 335 \f3      \-> java\&.util\&.regex                                    \fP
 336 .fi     
 337 .nf     
 338 \f3   com\&.sun\&.tools\&.jdeps (tools\&.jar)\fP
 339 .fi     
 340 .nf     
 341 \f3      \-> java\&.io                                            \fP
 342 .fi     
 343 .nf     
 344 \f3      \-> java\&.lang                                          \fP
 345 .fi     
 346 .nf     
 347 \f3      \-> java\&.nio\&.file                                      \fP
 348 .fi     
 349 .nf     
 350 \f3      \-> java\&.nio\&.file\&.attribute                            \fP
 351 .fi     
 352 .nf     
 353 \f3      \-> java\&.text                                          \fP
 354 .fi     
 355 .nf     
 356 \f3      \-> java\&.util                                          \fP
 357 .fi     
 358 .nf     
 359 \f3      \-> java\&.util\&.jar                                      \fP
 360 .fi     
 361 .nf     
 362 \f3      \-> java\&.util\&.regex                                    \fP
 363 .fi     
 364 .nf     
 365 \f3      \-> java\&.util\&.zip                                      \fP
 366 .fi     
 367 .nf     
 368 \f3/usr/java/jre/lib/jce\&.jar \-> /usr/java/jre/lib/rt\&.jar\fP
 369 .fi     
 370 .nf     
 371 \f3   javax\&.crypto (jce\&.jar)\fP
 372 .fi     
 373 .nf     
 374 \f3      \-> java\&.io                                            \fP
 375 .fi     
 376 .nf     
 377 \f3      \-> java\&.lang                                          \fP
 378 .fi     
 379 .nf     
 380 \f3      \-> java\&.lang\&.reflect                                  \fP
 381 .fi     
 382 .nf     
 383 \f3      \-> java\&.net                                           \fP
 384 .fi     
 385 .nf     
 386 \f3      \-> java\&.nio                                           \fP
 387 .fi     
 388 .nf     
 389 \f3      \-> java\&.security                                      \fP
 390 .fi     
 391 .nf     
 392 \f3      \-> java\&.security\&.cert                                 \fP
 393 .fi     
 394 .nf     
 395 \f3      \-> java\&.security\&.spec                                 \fP
 396 .fi     
 397 .nf     
 398 \f3      \-> java\&.util                                          \fP
 399 .fi     
 400 .nf     
 401 \f3      \-> java\&.util\&.concurrent                               \fP
 402 .fi     
 403 .nf     
 404 \f3      \-> java\&.util\&.jar                                      \fP
 405 .fi     
 406 .nf     
 407 \f3      \-> java\&.util\&.regex                                    \fP
 408 .fi     
 409 .nf     
 410 \f3      \-> java\&.util\&.zip                                      \fP
 411 .fi     
 412 .nf     
 413 \f3      \-> javax\&.security\&.auth                                \fP
 414 .fi     
 415 .nf     
 416 \f3      \-> sun\&.security\&.jca                                   JDK internal API (rt\&.jar)\fP
 417 .fi     
 418 .nf     
 419 \f3      \-> sun\&.security\&.util                                  JDK internal API (rt\&.jar)\fP
 420 .fi     
 421 .nf     
 422 \f3   javax\&.crypto\&.spec (jce\&.jar)\fP
 423 .fi     
 424 .nf     
 425 \f3      \-> java\&.lang                                          \fP
 426 .fi     
 427 .nf     
 428 \f3      \-> java\&.security\&.spec                                 \fP
 429 .fi     
 430 .nf     
 431 \f3      \-> java\&.util                                          \fP
 432 .fi     
 433 .nf     
 434 \f3/usr/java/jre/lib/rt\&.jar \-> /usr/java/jre/lib/jce\&.jar\fP
 435 .fi     
 436 .nf     
 437 \f3   java\&.security (rt\&.jar)\fP
 438 .fi     
 439 .nf     
 440 \f3      \-> javax\&.crypto\fP
 441 .fi     
 442 .nf     
 443 \f3\fP
 444 .fi     
 445 .sp     
 446 Generate dot files of the dependencies of Notepad demo\&.
 447 .sp     
 448 .nf     
 449 \f3$ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar\fP
 450 .fi     
 451 .nf     
 452 \f3\fP
 453 .fi     
 454 .sp     
 455 \f3jdeps\fR will create one dot file for each given JAR file named <\fIfilename\fR>\&.dot in the dot directory specified in the \f3-dotoutput\fR option, and also a summary file named summary\&.dot that will list the dependencies among the JAR files
 456 .sp     
 457 .nf     
 458 \f3$ cat dot/Notepad\&.jar\&.dot \fP
 459 .fi     
 460 .nf     
 461 \f3digraph "Notepad\&.jar" {\fP
 462 .fi     
 463 .nf     
 464 \f3    // Path: demo/jfc/Notepad/Notepad\&.jar\fP
 465 .fi     
 466 .nf     
 467 \f3   "<unnamed>"                                        \-> "java\&.awt";\fP
 468 .fi     
 469 .nf     
 470 \f3   "<unnamed>"                                        \-> "java\&.awt\&.event";\fP
 471 .fi     
 472 .nf     
 473 \f3   "<unnamed>"                                        \-> "java\&.beans";\fP
 474 .fi     
 475 .nf     
 476 \f3   "<unnamed>"                                        \-> "java\&.io";\fP
 477 .fi     
 478 .nf     
 479 \f3   "<unnamed>"                                        \-> "java\&.lang";\fP
 480 .fi     
 481 .nf     
 482 \f3   "<unnamed>"                                        \-> "java\&.net";\fP
 483 .fi     
 484 .nf     
 485 \f3   "<unnamed>"                                        \-> "java\&.util";\fP
 486 .fi     
 487 .nf     
 488 \f3   "<unnamed>"                                        \-> "java\&.util\&.logging";\fP
 489 .fi     
 490 .nf     
 491 \f3   "<unnamed>"                                        \-> "javax\&.swing";\fP
 492 .fi     
 493 .nf     
 494 \f3   "<unnamed>"                                        \-> "javax\&.swing\&.border";\fP
 495 .fi     
 496 .nf     
 497 \f3   "<unnamed>"                                        \-> "javax\&.swing\&.event";\fP
 498 .fi     
 499 .nf     
 500 \f3   "<unnamed>"                                        \-> "javax\&.swing\&.text";\fP
 501 .fi     
 502 .nf     
 503 \f3   "<unnamed>"                                        \-> "javax\&.swing\&.tree";\fP
 504 .fi     
 505 .nf     
 506 \f3   "<unnamed>"                                        \-> "javax\&.swing\&.undo";\fP
 507 .fi     
 508 .nf     
 509 \f3}\fP
 510 .fi     
 511 .nf     
 512 \f3\fP
 513 .fi     
 514 .nf     
 515 \f3$ cat dot/summary\&.dot\fP
 516 .fi     
 517 .nf     
 518 \f3digraph "summary" {\fP
 519 .fi     
 520 .nf     
 521 \f3   "Notepad\&.jar"                  \-> "rt\&.jar";\fP
 522 .fi     
 523 .nf     
 524 \f3}\fP
 525 .fi     
 526 .nf     
 527 \f3\fP
 528 .fi     
 529 .sp     
 530 .SH SEE\ ALSO    
 531 .TP 0.2i    
 532 \(bu
 533 javap(1)
 534 .RE
 535 .br
 536 'pl 8.5i
 537 'bp