javajava-9jdepsjdeprscan

What is the difference between Jdeps & Jdeprscan?


In Java 9 a new tool jdeprscan has been introduced, which is quite similar to the existing jdeps tool.

As per my understanding jdeprscan's primary motive is to harness the usage of 'for-removal' & 'release' attributes of the Deprecated annotation.

Is there any other scenario or usage for this tool, which cannot be performed using JDeps?


Solution

  • Your understanding in terms of what jdeprscan does is correct. The jdeprscan tool is precisely meant for

    static analysis scanning a JAR file or some other aggregation of class files for uses of deprecated API elements.

    It's also important to note that

    The deprecated APIs identified by the jdeprscan tool are only those that are defined by Java SE. Deprecated APIs defined by third-party libraries aren’t reported.


    Though, IMO you shall also understand that there is no comparison of the tool with jdeps, which on the other hand is not meant to identify deprecated APIs but instead analyze the dependencies of a class/package.

    In short, they are exclusive in functionality.