Java Tools Tutorials - Herong's Tutorial Examples - v6.23, by Herong Yang
"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
javac - The Java Program Compiler
java - The Java Program Launcher
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
jcmd - The JVM Diagnostic Tool
jconsole - Java Monitoring and Management Console
jstat - JVM Statistics Monitoring Tool
jhsdb - The Java HotSpot Debugger
jvisualvm (Java VisualVM) - JVM Visual Tool
javap - The Java Class File Disassembler
keytool - Public Key Certificate Tool
jrunscript - Script Code Shell
native2ascii - Native-to-ASCII Encoding Converter