"jdeps class_file" - Dependencies of Class File

This section provides a tutorial example on how to use 'jdeps' command to show package level dependencies of a given Java class file.

If you want to know package level dependencies of a given Java class file, you can run the "jdeps class_file" command.

Let's use the ImportTestA.java program presented previous as an example:

/* ImportTestA.java
 * Copyright (c) 2005 HerongYang.com. All Rights Reserved.
 */
import com.herongyang.util.*;
public class ImportTestA {
   public static void main(String[] arg){
      ClsA a = new ClsA();
      a.printInfo();
      ClsB b = new ClsB();
      b.printInfo();
   }
}

Compile the program to get the Java class file:

herong> javac ImportTestA.java

herong> dir
    <DIR>          com
               404 ImportTestA.class
               292 ImportTestA.java

Run the "jdeps" command to show package level dependencies of the class file, ImportTestA.class:

herong> jdeps ImportTestA.class

ImportTestA.class -> java.base
ImportTestA.class -> not found
   <unnamed>      -> com.herongyang.util      not found
   <unnamed>      -> java.lang                java.base

The output shows that:

Table of Contents

 About This Book

 Java Tools Terminology

 Java Tools Included in JDK

 javac - The Java Program Compiler

 java - The Java Program Launcher

 jar - The JAR File Tool

 jlink - The JRE Linker

 jmod - The JMOD File Tool

 jimage - The JIMAGE File Tool

 jpackage - Binary Package Builder

 javadoc - The Java Document Generator

jdeps - The Java Class Dependency Analyzer

 jdeps - Class Dependency Analyzer Command

"jdeps class_file" - Dependencies of Class File

 "jdeps -verbose" - Class Level Dependencies of Class File

 "jdeps jar_file" - Dependencies of JAR File

 "jdeps --inverse --require ..." - Reverse Dependencies

 jdeprscan - The Java Deprecated API Scanner

 jdb - The Java Debugger

 jcmd - The JVM Diagnostic Tool

 jconsole - Java Monitoring and Management Console

 jstat - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jhsdb - The Java HotSpot Debugger

 jvisualvm (Java VisualVM) - JVM Visual Tool

 jmc - Java Mission Control

 javap - The Java Class File Disassembler

 keytool - Public Key Certificate Tool

 jarsigner - JAR File Signer

 jshell - Java Language Shell

 jrunscript - Script Code Shell

 Miscellaneous Tools

 native2ascii - Native-to-ASCII Encoding Converter

 JAB (Java Access Bridge) for Windows

 Archived Tutorials

 References

 Full Version in PDF/EPUB