How to do it...

  1. The simplest way to use jdeps is as follows:
# On Linuxjdeps -cp classes/:lib/* classes/com/packt/Sample.class# On Windowsjdeps -cp "classes/;lib/*" classes/com/packt/Sample.class

The preceding command is equivalent to the following:

# On Linuxjdeps -verbose:package -cp classes/:lib/*      classes/com/packt/Sample.class# On Windowsjdeps -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 ...

Get Java 11 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.