简体   繁体   中英

Method of finding all the classes used by a main class

I am provided with a workspace where i have to extract few classes. I know the main classes which have to be extracted. Is there a way in eclipse which lists all the classes used by this main class. Indirect and direct references of this class.

For example: I have main class A which uses class B and class C. Class C internally uses class D. So for all the classes used in A should list B,C and D.

You can delete the classes folder of your application and compile only the class you want to obtain dependencies for using javac where you provide the classpath of dependent jars (if any). The java compiler will find all the dependencies of this class and compile them as well:

javac -classpath dep1.jar;dep2.jar path.to.your.class.YourClass.java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM