A
A
Artem Parfenov2014-06-20 12:37:37
Java
Artem Parfenov, 2014-06-20 12:37:37

How to find out from which jar a class is imported?

Suppose class A code uses class B, whose definition is in a third-party jar library that we import into class A. How can I find out the full path to the jar file from which this class B is imported if, among other things, I import classes C, D and E?
For example, in Eclipse, in the BuildPath of the project, there are a ton of jar files and, let's say, they are named in such a way that looking at them it is impossible to understand by the package name whether the corresponding class is inside or not

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lo-fi, 2014-06-20
@hrls

In Eclipse, you can try to simply go to the class code (Ctrl+Click), which will result in a window with a message that means "sources for the class from jar not found" with the full path to the jar file, taking into account the order of appearance of the libraries in the classpath.

A
Artem Parfenov, 2014-06-23
@getmanartem

@hrls yes, it will work, but only up to the first level, and in my case, as @pi314 noted, the dependency seems to be transitive

T
tavi, 2014-06-25
@tavi

I came across in this context a mention of a certain Tattletale tool :
Perhaps this will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question