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