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?
The jdeps command shows the package-level or class-level dependencies of Java class files. The input class can be a path name to a . class file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files.
You can find the JDeps executable jdeps in your JDK's bin folder since Java 8. Working with it is easiest if it is available on the command line, for which you might have to perform some setup steps specific to your operating systems. Make sure that jdeps --version works and shows that the Java 9 version is running.
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.
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.
Unlike jdeps, jdeprscan only exists as a command line tool, and does not provide any direct API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With