Hi,
In Windows, we can use Microsoft's "DEPENDS.EXE" to show the
dependences between .dll files. e.g., a.dll depends on b.dll.
In Linux, we can use "ldd" utility to show the dependences between .so
files. e.g., a.so depends on b.so.
Now I have two .jar files(a.jar and b.jar) and I want to know whether
a.jar depends on b.jar or not. How to?
Thanks!
Best Regards,
Xie, Bo
Andrew Thompson - 10 Jan 2007 12:59 GMT
...
> In Windows, we can use Microsoft's "DEPENDS.EXE" to show the
> dependences between .dll files. e.g., a.dll depends on b.dll.
[quoted text clipped - 3 lines]
> Now I have two .jar files(a.jar and b.jar) and I want to know whether
> a.jar depends on b.jar or not. How to?
In Java these things are often documented in the
documentation (especially JavaDocs). Though a
compilation of the source of a project should indicate
the class dependencies.
Why is it, that you are effectively needing to
'work this out' rather than 'read the docs.'?
Andrew T.
xie bo - 10 Jan 2007 13:23 GMT
> In Java these things are often documented in the
> documentation (especially JavaDocs). Though a
[quoted text clipped - 3 lines]
> Why is it, that you are effectively needing to
> 'work this out' rather than 'read the docs.'?
Actually I have not the Javadoc. What I have is just a .jar file. I
know I can de-compile the .jar file and know the dependence by checking
the decompiled source code. But it is not an elegant approach.
I am a Java newbie and I think it is a common problem: How to know the
dependent .jar files for a given .jar file? ( Just like how to know a
.dll or .so file's dependence)
Andrew Thompson - 10 Jan 2007 13:29 GMT
> > In Java these things are often documented in the
> > documentation (especially JavaDocs). Though a
[quoted text clipped - 5 lines]
>
> Actually I have not the Javadoc. What I have is just a .jar file.
Like.. from where? Who gave it to you?
How is it launched?
>...I
> know I can de-compile the .jar file and know the dependence by checking
> the decompiled source code. But it is not an elegant approach.
>
> I am a Java newbie and I think it is a common problem:
You think wrong.
>..How to know the
> dependent .jar files for a given .jar file? ( Just like how to know a
> .dll or .so file's dependence)
Do .dll's usually come with *documentation*?
I don't see any lying around on my Win. box.
Andrew T.
xie bo - 10 Jan 2007 15:43 GMT
> > I am a Java newbie and I think it is a common problem:
>
> You think wrong.
Actually I am looking for 'JarAnalyzer'-like tool [1].
Reference
1. http://www.kirkk.com/main/Main/JarAnalyzer
Andrew Thompson - 10 Jan 2007 15:55 GMT
> > > I am a Java newbie and I think it is a common problem:
> >
> > You think wrong.
>
> Actually I am looking for 'JarAnalyzer'-like tool [1].
Just because a tool exists, does not mean either..
a) it is a common problem, or
b) you are approaching this the right way, or..
c) you would actually have the sense to answer
my questions, rather than simply treat this
discussion forum as if it were a help desk.
Andrew T.
Nigel Wade - 10 Jan 2007 15:50 GMT
> Hi,
>
[quoted text clipped - 10 lines]
> Best Regards,
> Xie, Bo
Look in the manifest file in the jar. That should specify the classpath for the
jar, including any other jar's on which the jar depends. If the jar builder
didn't actually specify any, then blame that on the jar builder.
It's just the same as someone not linking a DLL/DSO against dependent DLL/DSOs,
so whoever uses it has to find which library the unresolved references are
located in. ldd only knows about dependencies because the developer who built
the DSO added the dependencies to the command when the DSO was linked (I don't
know how depends works on Windows).

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555