I have a jar file. I want to know which external classes and methods are used by classes inside JAR file. Can anyone suggest me any tool?
For example – if below two classes are packaged into Myjar.jar
import java.util.Vector;
class MyJarClass{
public static void main(String args[]){
Vector v = new Vector();
AnotherClass another = new AnotherClass();
v.addElement("one");
another.doSomething();
}
}
class AnotherClass{
void doSomething(){
}
}
When I supply that JAR to a tool – the tool should show java.util.Vector and Vector.adElements() are from external source (not present in MyJar.jar)
Forgot to mention, i don’t have access to sourcecode.
Easy
Possible
A challenge
Mission impossible
I support Jon’s advice to look at the byte code (BCEL) but just be aware, that in general it is not possible to read all dependencies from a jar, as they can be dynamic and defined outside the library (see: Mission impossible).
Hard to tell if there’s a tool, have a look at those directories on java-source.net:
Further reading