Akhil Patro
Akhil Patro

Reputation: 454

How to trace Deprecated java API's during run time?

I am using Nashorn APIs for executing Javascripts using Java code. Nashorn is deprecated terminally in JDK 11. Currently I am on JDK 8 where some of the APIs are deprecated. Is it possible to trace the deprecated APIs during runtime ?

Upvotes: 1

Views: 82

Answers (1)

jbx
jbx

Reputation: 22178

I presume that by "run time" you mean after the application has been compiled, and you have executable bytecode.

The tool jdeprscan might help.

https://docs.oracle.com/javase/9/tools/jdeprscan.htm

Not sure if it provides the information you need. It won't be at "run time", but it will scan the application's Jar to see if there are calls to deprecated APIs. So you might actually get false positives.

Upvotes: 2

Related Questions