I want to use the code of an open source java library, but I don't need all classes/packages of this library, but only some of them. How can I automatically get to know which ones of the packages/classes/methods are employed when I submit a certain input to it?
Asked
Active
Viewed 41 times
0
-
Does [this](http://stackoverflow.com/a/947216/5044950) answer your question? – Sam Estep Jun 25 '15 at 02:48
-
Looks very much like what I need, thank you. Is there something more automated? I mean, a tool that will produce the list of files I need to copy to my project (for a lazy programmer ;). – aburkov Jun 25 '15 at 03:14
-
I haven't personally tried it, but I assume you could run the program and redirect the output to a file. If the program prints output of its own, there might be a way to suppress that output (if there isn't, I'm not sure what to do). Then you can write a simple parser that reads that file and generates a list of the files you need. You really should look into some sort of build tool that handles dependencies and such for you. – Sam Estep Jun 25 '15 at 03:17
-
Why do you want to pull in just some of the classes and not the entire jar? Are you manually downloading the jar and putting it in the class path? If yes, then start using Maven or Gradle for your Project management specially for dependency management in your project. – systemhalted Jun 25 '15 at 03:37
1 Answers
1
If you know how to use the java debugger, you will just have to click step into and step over. Then from the debug window, you will know what kinds of methods or classes are used.

xysr89
- 19
- 1