How has jdeps changed in recent Java versions?

In recent Java versions, particularly from Java 9 onwards, jdeps (Java Dependency Analyzer) has undergone several enhancements that improve its functionality and usability. These changes aim to assist developers in analyzing class dependencies across modules and packages, making it easier to migrate applications to the module system introduced in Java 9.

Key Changes in jdeps:

  • Module Support: jdeps now fully supports the Java Platform Module System (JPMS), enabling users to analyze dependencies between modules.
  • Enhanced Output Formats: jdeps has improved output options, including JSON and XML formats, making it easier to integrate with other tools.
  • Automatic Module Name Detection: jdeps can now automatically detect and suggest module names for classes that do not include module descriptors.
  • API Usage Analysis: The tool can analyze which Java APIs are used by an application, helping to identify deprecated APIs and making it easier to update code.

Example Usage:

jdeps --module-path mods --class-path bin --verbose yourpackage.YourClass

jdeps Java Dependency Analyzer Java 9 JPMS module support dependency analysis API usage