Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 574
Curious Coder Avatar asked Feb 07 '18 10:02

Curious Coder


People also ask

What is JDeps used for?

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.

Where is Jdeps?

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.

Which of the following can be a valid input for Jdeps dependency Analyser?

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.


2 Answers

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.

like image 196
Naman Avatar answered Oct 08 '22 08:10

Naman


Unlike jdeps, jdeprscan only exists as a command line tool, and does not provide any direct API.

like image 31
Oleksandr Pyrohov Avatar answered Oct 08 '22 07:10

Oleksandr Pyrohov