Questions tagged [jdeprscan]

jdeprscan is a static analysis tool which can be used for scanning an aggregation of the class files in for the use of deprecated API elements. Its usage is as :

jdeprscan [ options ]{dir|jar|class}

Example of its usage is :

jdeprscan commons-math3-3.6.1.jar 

where one line of output might be:

class org/apache/commons/math3/util/MathUtils uses deprecated method
java/lang/Double::<init>(D)V

The name of the deprecated method is , which is a special name that means that the method is actually a constructor. Another special name is , which indicates a class static initializer. Other methods are just listed by their method name. Following the method name is the argument list and return type: (D)V. This indicates that it takes a single double value (a primitive) and returns void

The argument and return types can become cryptic. For example, another line of output might be:

class org/apache/commons/math3/util/Precision uses deprecated method
java/math/BigDecimal::setScale(II)Ljava/math/BigDecimal;

In this line of output, the deprecated method is on class java.math.BigDecimal, and the method is setScale(). In this case, the (II) means that it takes two int arguments. The Ljava/math/BigDecimal; after the parentheses means that it returns a reference to java.math.BigDecimal.

8 questions
8
votes
2 answers

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…
Curious Coder
  • 646
  • 8
  • 18
3
votes
1 answer

How to run `jdeprscan` on an EAR

The jdeprscan tool determines lists all deprecated and non-existing dependencies. It can run on classes, directories and on a JAR. But how to run it on an EAR ?
Julien Kronegg
  • 4,968
  • 1
  • 47
  • 60
3
votes
2 answers

jdeprscan warning with --release 8

I have a standalone project based on Java-9 with a single class Main.java on which I was experimenting with the jdeprscan tool pivoted over the Java SE release, when I ran the same using release 9 on my project there were no logs(assuming that being…
Naman
  • 27,789
  • 26
  • 218
  • 353
2
votes
0 answers

Command not found: jdeprscan

(base) User:Desktop user$ jdeprscan JavaStruct.class -bash: jdeprscan: command not found (base) User:Desktop user$ java --version java 11.0.7 2020-04-14 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS) Java HotSpot(TM) 64-Bit Server VM…
nzare
  • 23
  • 6
1
vote
2 answers

jdeprscan throws cannot find class error

I'm trying jdeprscan on my CentOS system. Here are the commands that I'm executing: export classpath=:: jdeprscan --for-removal --verbose --class-path $classpath --release 9 /MyProject.jar In…
Curious Coder
  • 646
  • 8
  • 18
0
votes
0 answers

jdeprscan resulting in many "cannot find class" errors

I have a Java REST API that uses JDK8 and Spring Boot 2.6.8. I plan to upgrade it to JDK17 and Spring Boot 3.x. I ran jdeprscan against its jar to determine which classes, etc., I need to update: jdeprscan target\myapplication.jar But I get a bunch…
Woodchuck
  • 3,869
  • 2
  • 39
  • 70
0
votes
1 answer

How can I get the list of all possible packages from lib/ directory using jigsaw helper commands?

I'm not currently building a modular app. However I've seen that that jdeps/jdeprscan can scan into jars for packages. Is there a way to just print all packages contained in all jars inside lib/ using any of the above commands?
Marinos An
  • 9,481
  • 6
  • 63
  • 96
0
votes
0 answers

Running jdeprscan with specific JDK

I found out about jdeprscan and there is something that is bugging me about following command jdeprscan --class-path classes --release 8 c:\jars\activation-1.1.jar In here ( from what I believe I understood ) I am running specific jar with specific…
zawarudo
  • 1,907
  • 2
  • 10
  • 20