dcsimg
Anybody know if there's a "which" command for classes?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rod_Macpherson
Posted On:   Monday, January 20, 2003 05:56 PM

I would like to know "which" jars contain a specific class based on the current classpath. Is there a standard command for this anywhere?


Print names of jars in the current directory containing a class named Foobar along with a fully qualitfied package name:

java -classpath . Which Foobar



This would be useful when you are looking at an example or a piece of code with a mile high stack of imports.

Re: Anybody know if there's a "which" command for classes?

Posted By:   Anonymous  
Posted On:   Tuesday, January 21, 2003 04:34 AM

I donĀ“t know any "standard" way. I am using JWhich:

"JWhich is a simple tool that unambiguously identifying which Java class in your classpath will be loaded. Depending on the complexity of your classpath, it's not always clear which class will be loaded first by the Java class loader. JWhich displays the absolute pathname of the class file loaded first by the Java class loader.


JWhich also analyzes the Java classpath and reports any non-existent files or directories, indicating potential classpath errors."
(from their Website).
About | Sitemap | Contact