# Java 8 - jdeps - Integriertes Tool zur Analyse von Abhängigkeiten von Jar-Archiven



## Thomas Darimont (11. Juni 2013)

Hallo,

in Java 8 ist mit jdeps ein interessantes neues Tool zur Analyse von Abhängigkeiten von jar-Archiven integriert. 
Siehe auch Diskussion unter: http://mail.openjdk.java.net/pipermail/compiler-dev/2012-December/005118.html

Command-line Hilfe zu jdeps:

```
C:\Program Files\Java\jdk1.8.0\bin>jdeps
Usage: jdeps <options> <classes...>
where <classes> can be a pathname to a .class file, a directory, a JAR file,
or a fully-qualified classname or wildcard "*".  Possible options include:
  -s         --summary                 Print dependency summary only
  -v         --verbose                 Print additional information
  -V <level> --verbose-level=<level>   Print package-level or class-level dependencies
                                       Valid levels are: "package" and "class"
  -c <path>  --classpath=<path>        Specify where to find class files
  -p <pkg name> --package=<pkg name>   Restrict analysis to classes in this package
                                       (may be given multiple times)
  -e <regex> --regex=<regex>           Restrict analysis to packages matching pattern
                                       (-p and -e are exclusive)
  -P         --profile                 Show profile or the file containing a package
  -R         --recursive               Recursively traverse all dependencies
             --version                 Version information
```

Hier mal als Beispiel die Analyse der Abhängigkeiten zwischen dem rt.jar und den jce.jar (Java Cryptography Extensions).

Aufruf:

```
C:\Program Files\Java\jdk1.8.0\bin>jdeps ..\jre\lib\rt.jar ..\jre\lib\jce.jar
```

Ausgabe:

```
..\jre\lib\rt.jar -> ..\jre\lib\jce.jar
..\jre\lib\rt.jar -> C:\Program Files\Java\jdk1.8.0\jre\lib\jsse.jar
   com.sun.org.apache.xml.internal.security.algorithms.implementations (rt.jar)
      -> javax.crypto                                       jce.jar
   com.sun.org.apache.xml.internal.security.encryption (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   com.sun.org.apache.xml.internal.security.keys (rt.jar)
      -> javax.crypto                                       jce.jar
   com.sun.org.apache.xml.internal.security.keys.keyresolver (rt.jar)
      -> javax.crypto                                       jce.jar
   com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations (rt.jar)
      -> javax.crypto                                       jce.jar
   com.sun.org.apache.xml.internal.security.signature (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   com.sun.security.ntlm (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   com.sun.security.sasl.digest (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   java.security (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   javax.security.auth.kerberos (rt.jar)
      -> javax.crypto                                       jce.jar
   org.jcp.xml.dsig.internal (rt.jar)
      -> javax.crypto                                       jce.jar
   org.jcp.xml.dsig.internal.dom (rt.jar)
      -> javax.crypto                                       jce.jar
   sun.net.www.protocol.https (rt.jar)
      -> sun.security.ssl                                   JDK internal API (jsse.jar)
   sun.security.jgss (rt.jar)
      -> javax.crypto                                       jce.jar
   sun.security.jgss.krb5 (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   sun.security.krb5 (rt.jar)
      -> javax.crypto.spec                                  jce.jar
   sun.security.krb5.internal.crypto (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   sun.security.krb5.internal.crypto.dk (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   sun.security.pkcs12 (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   sun.security.provider (rt.jar)
      -> javax.crypto.spec                                  jce.jar
   sun.security.rsa (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.spec                                  jce.jar
   sun.security.tools.keytool (rt.jar)
      -> javax.crypto                                       jce.jar
   sun.security.util (rt.jar)
      -> javax.crypto                                       jce.jar
      -> javax.crypto.interfaces                            jce.jar
      -> javax.crypto.spec                                  jce.jar
      -> sun.security.ssl                                   JDK internal API (jsse.jar)
..\jre\lib\jce.jar -> ..\jre\lib\rt.jar
   javax.crypto (jce.jar)
      -> java.io                                            rt.jar
      -> java.lang                                          rt.jar
      -> java.lang.reflect                                  rt.jar
      -> java.net                                           rt.jar
      -> java.nio                                           rt.jar
      -> java.security                                      rt.jar
      -> java.security.cert                                 rt.jar
      -> java.security.spec                                 rt.jar
      -> java.util                                          rt.jar
      -> java.util.concurrent                               rt.jar
      -> java.util.jar                                      rt.jar
      -> java.util.regex                                    rt.jar
      -> java.util.zip                                      rt.jar
      -> javax.security.auth                                rt.jar
      -> sun.security.jca                                   rt.jar
      -> sun.security.util                                  rt.jar
      -> sun.security.validator                             rt.jar
      -> sun.security.x509                                  rt.jar
   javax.crypto.interfaces (jce.jar)
      -> java.lang                                          rt.jar
      -> java.math                                          rt.jar
      -> java.security                                      rt.jar
   javax.crypto.spec (jce.jar)
      -> java.lang                                          rt.jar
      -> java.math                                          rt.jar
      -> java.security                                      rt.jar
      -> java.security.spec                                 rt.jar
      -> java.util                                          rt.jar
   sun.security.internal.interfaces (jce.jar)
      -> java.lang                                          rt.jar
   sun.security.internal.spec (jce.jar)
      -> java.lang                                          rt.jar
      -> java.security.spec                                 rt.jar
```

Gruß Tom


----------



## ComFreek (11. Juni 2013)

Mal hoffen, dass es dazu noch GUI-Clients entwickelt werden 


Danke für die Info!


----------

