O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. The simplest way to use jdeps is as follows:
      jdeps -cp classes/:lib/* classes/com/packt/Sample.class

The preceding command is equivalent to the following:

      jdeps -verbose:package -cp classes/:lib/*      classes/com/packt/Sample.class

The output for the preceding code is as follows:

In the preceding command, we use jdeps to list the dependencies for the class file, Sample.class, at the package level. We have to provide jdeps with the path to search for the dependencies of the code being analyzed. This can be done by setting the -classpath, -cp, or --class-path option of the jdeps command.

The -verbose:package option lists the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required