Which And What Utilities Which And What Utilities
home Student Projects no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. It does not describe an actual complete program. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; I have too many other projects of my own.

I do contract work for a living, which could include writing a program such as this. However, I don’t do people’s homework for them. That just robs them of an education.

You have my full permission to implement this project any way you please.

This is similar to the PathTool project. These are some simple command line diagnostic tools:
  1. which p.exe This searches the current path for the given executable file (fully qualified). It then displays all the occurences it finds, i.e. the fully qualified directories where it found that file, and sets the return code to the number of instances it finds.
  2. which X.Y.P.class does the same thing, but search the classpath, including any jars in the classpath for instances of X.Y.P.class. You can use simple wildcards such as *.P.class to look for the class in any package. *.*.class would get you a list of all classes available on the classpath. The search is case insensistive, but since Java is case sensitive, only case sensitive matches appear in the count. Case mismatches are highlighted.
  3. which getSize.method does the same thing, but search the classpath, including any jars in the classpath for instances of classes containing a getSize method. More elaborate versions would let you specify a more specific method signature. The utility should take a -cp option on the command line, defaulting to the SET classpath if there is none.
  4. what C:\temp\ThisFile.class Displays the fully qualified classname of the class corresponding to the file.
  5. what C:\temp\ThisJar.jar Displays the fully qualified classnames of all the classes in the jar.
Your what utility might be expanded to tell you interesting facts about other types of file. Eg. Ideally this is runs on any platform unmodified, though if you find yourself needing JNI, try at least to support both Windows and Linux, using JAWS to select the correct native class.
Interface Finder: find classes on classpath implementing a given inteface
jar
jar verifier Project
JarCheck
JarLook
Java class finder: searches local disk jars for classes
Java Jar Catalog Project
Path and Classpath tool project

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.18] The information on this page is for non-military use only.
You are visitor number 3,128. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/project/which.html J:\mindprod\project\which.html