Java class dependency analyzer in Java 8 with Examples Last Updated : 29 Jan, 2020 Comments Improve Suggest changes Like Article Like Report Java class dependency analyzer: jdeps is a new command-line tool introduced in JDK 8 to understand the static dependencies and libraries of application i.e. jdeps command shows the package-level or class-level dependencies of Java class files. The input for jdeps can be a .class file pathname, a JAR file or it can be a fully qualified class name to analyze all class files. Whenever we provide any input to jdeps command line tool then it generates the dependencies to the system console. jdeps introduced with various options which affect the output. As per option, jdeps command-line tool generates the output. Example: Java // Simple Java program to see the jdeps // generated output with various options import java.util.List; import java.util.ArrayList; class Geeks { public static void main(String args[]) { List<String> list1 = new ArrayList<>(); List<String> list2 = new ArrayList<>(); List<String> list3 = new ArrayList<>(); list1.add("Geeks"); list2.add("for"); list3.add("geeks"); System.out.println(list1); System.out.println(list2); System.out.println(list3); } } Note: We have to compile above Geeks.java file and compiler will generate Geeks.class file and We have to use this file as an input for jdeps. Here I am running with Java 9 and we will see the output of jdeps with different options for this Geeks.class file as per Java 9. Output: jdeps Geeks.class Various options available for jdeps: -dotoutput directoryPath: If we will use this option, then jdeps will generate one dot file into the directory per each analyzed archive named .dot listing the dependencies. It will also generate a summary file named summary.dot specifying the dependencies among the archives. Output: jdeps -dotoutput C:\Users\DubeyBis\Desktop\jdeps Geeks.class It will generate two files inside C:\Users\DubeyBis\Desktop\jdeps folder with the name Geeks.class.dot and summary.dot and the content of these files are below: Geeks.class.dot digraph "Geeks.class" { // Path: Geeks.class "" -> "java.io (java.base)"; "" -> "java.lang (java.base)"; "" -> "java.lang.invoke (java.base)"; "" -> "java.util (java.base)"; } summary.dot digraph "summary" { "Geeks.class" -> "rt.jar"; } -summary: It will print only the summary. Instead of -summary, we can use -s also. Output: jdeps -summary Geeks.class -verbose: It will print all class-level dependencies. Instead of -verbose, we can use -v also. Output: jdeps -verbose Geeks.class -verbose:package: Prints package-level dependencies excluding dependencies within the same archive. -verbose:class: Prints class-level dependencies excluding dependencies within the same archive. Output: jdeps -verbose:class Geeks.class Comment More infoAdvertise with us Next Article Java class dependency analyzer in Java 8 with Examples bishaldubey Follow Improve Article Tags : Java Technical Scripter DSA Technical Scripter 2019 Java 8 Java-Classes +2 More Practice Tags : Java Similar Reads Java - Divide the Classes into Packages with Examples Let us first know what is a class and package in Java. Class in java is a model for creating objects. It means that the properties and actions of the objects are written in class. Properties are represented by variables and actions of the objects are represented by methods. So, a class contains vari 6 min read javap tool in Java with Examples javap tool The javap tool is used to get the information of any class or interface. The javap command (also known as the Java Disassembler) disassembles one or more class files. Its output depends on the options used (â-câ or â-verboseâ for byte code and byte code along with innards info, respective 2 min read Java Deprecated API Scanner tool (jdepscan) in Java 9 with Examples Java Deprecated API Scanner tool: Java Deprecated API Scanner tool i.e. jdeprscan is a static analyzing command-line tool which is introduced in JDK 9 for find out the uses of deprecated API in the given input. Here the input can be .class file name, directory or JAR file. Whenever we provide any in 2 min read Dependency Injection with Dagger 2 in Android If there are two classes, class A and class B and class A depends on class B then class B is called dependent for class A.So, Every time we want to access class B in class A we need to create an instance of class B in Class A or use static factory methods to access class A. But this will make our co 7 min read Java.net.JarURLConnection class in Java Prerequisite - JAR files in Java What is a Jar file? JavaArchive(JAR) bundles all the classes in one package. Since the archive is compressed and can be downloaded in a single HTTP connection, it is often faster to download the archive than to download individual classes. Although jar bundles all th 4 min read Package getPackages() method in Java with Examples The getPackages() method of java.lang.Package class is used to get the Packages defined by the caller's class loader. The method returns the packages as an array of Package objects. Syntax: public boolean getPackages(String desiredVersion) Parameter: This method does not accept any parameter. Return 3 min read Spring @ComponentScan Annotation with Example Spring is one of the most popular frameworks for building enterprise-level Java applications. It is an open-source, lightweight framework that simplifies the development of robust, scalable, and maintainable applications. Spring provides various features such as Dependency Injection (DI), Aspect-Ori 3 min read What is the best way to inject Dependency in Java? You can transform standard Java classes into manageable objects by using dependency injection. Your programs can define dependencies on any managed object by using dependency injection. In addition to managing the life cycle of these instances for you, the container automatically supplies instances 7 min read java.lang.reflect.Field Class in Java The ability of the software to analyze itself is known as Reflection. This is provided by the java.lang.reflect package and elements in Class .Field serves the same purpose as the whole reflection mechanism, analyze a software component and describe its capabilities dynamically, at run time rather t 5 min read Java 9 Features with Examples Java is a general-purpose, high-level programming language developed by Sun Microsystems. It is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. Java was meant to follow the "Write Once Run Anywhere" (WORA) principle, i.e., J 6 min read Like