Re: Classes "Dependency Walker"?
Elena wrote:
Thank you very much for your answers. I don't think a proper one has
been posted. Maybe I've stated my need in a wrong way.
Let me a bit more explicit in my answer:
In the Windows development world, the basic unit of dependence is DLL files.
In Java, the basic unit of dependence is class files, which just happens
to be packaged into jars. It is possible--excluding class loader
shenanigans--to tell you what classes your Java program will use, but
there's no easy way to map these into jar files since they need not be
in the same jar file. I could theoretically repackage the JRE 7 runtime
into java7rt.jar and have stuff work but trying to repackage Vista's
kernel32 into vistakernel32.dll would break stuff.
I was wondering if there was an easy way to track down wrong
configurations and classpath conflicts. For instance, if a customer
calls, I can easily make the application trace: operating system,
paths and versions of loaded DLLs and so forth. What about a Java
application? Maybe the -verbose flag could help? Thanks.
For Sun's JVMs, it is possible to get Java to tell you its current
classpath via the java.class.path system property; java.ext.dirs also
tells you the extension directory. The documentation for
System.getProperties() implies that all JVMs must have these properties,
so it should work on non-Sun JVMs as well.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth