Is there any way to make java compiler list all the classes used in the compiled source code?
For example, for code:
import foo.bar.Hello;
import java.util.List;
...
Hello hello = ...
String string = ...
List list = ...
I would like to get
java.lang.String
java.util.List
foo.bar.Hello
Edit
- I want it at compile time (or after compilation finishes), not runtime.
Related
Obtaining a list of all classes used while running a Java application? is related, but it is about runtime, and I don't want to run the program, just compile.