Java 9 : jdeprscan

This tool is used for scanning the usage of deprecated APIs in a given JAR file,
classpath, or source directory. Suppose we have a simple class that makes use of the
deprecated method, addItem, of the  java.awt.List class, as follows:

import java.awt.List;
public class Test{
public static void main(String[] args){
List list = new List();
list.addItem("Hello");
}
}

Compile the preceding class and then use jdeprscan, as follows:

C:Program FilesJavajdk-9bin>jdeprscan.exe -cp . Test

You will notice that this tool prints out class Test uses method java/awt/List addItem (Ljava/lang/String;) deprecated, which is exactly what we expected.

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation