java - how to know which class / package/ methods used by given jar file? -


I have a jar file, I want to know that external classrooms and methods are used by classes inside the JR file . Can anyone suggest any tool to me?

For example - if the two sections below are packed in myjar.jar

  import java.util.Vector; Square MyJarClass {public static zero main (string arguments []) {vector v = new vector (); Other class second = new other class (); V.addElement ("A"); Another.doSomething (); When I supply that jar for a device - the device should be shown to  java.util.Vector  and     code> Vector.ad elements ()  are from external sources (not present in  MyJar.jar ) 

forgot to mention, I do not have access to source code is.

easy

  import com example . *;  

Possible

  list & lt; Com.example.MyType & gt; = New Arrestist & lt; Com.example.MyType & gt; ();  

a challenge

  class  

Impossible mission

  list & lt; String & gt; Class = getClassNamesFromUrl ("http://example.com/classes.txt"); For (string classname: classes) {doSomethingWith (class.forName (className)); }  

I support John's advice to look at the Byte Code (BCEEL), but just be aware, because it is not possible to read all dependencies in jars normally They can be dynamic.


It is difficult to say that there is a device, then look at those directories:

  • (Some For working on the jar in applications, it is also like the Zendaprad. Journalist has also promised, but this is a lot
  • Further studies

    • (especially)

Comments