> Has anyone written a tool like this?
>
[quoted text clipped - 10 lines]
> I tell it someprog.exe then it tells me all the places on the path it
> found someprog.exe
The Unix 'whence' command lists the first occurrence of a specified
command in $PATH. If you don't have the real 'whence', you can implement
it as a script, something like
FAILMSG=`file /elsewhere/nosuchfilehere 2>/dev/stdout|grep
nosuchfilehere|tail -c 20`
file `echo $PATH|awk -v sought=$1 'BEGIN{FS=":"};{for (jj=NF; jj>0;
--jj) {print $jj "/" sought;}}'`|grep -v "$FAILMSG"
> I tell it someprog and it tells me all the places on the path it found
> someprog.exe, someprog.com, someprog.bat, and someprog.btm then tells
> me which one I would get.
I'm not familiar enough with Windows scripting to say if this could
be done in a script.
> I tell it com.mindprod.bulk.SomeClass.class It tells me all the places
> on the classpath (including the active ext jars) that it finds this
[quoted text clipped - 5 lines]
> tells me which one javac would actually use. The package name is
> optional.
Most of this is implemented in ZipLock. See the storeClass(String
className) method and the openResource(,) method it calls, in
http://www.bmsi.com/java/ZipLock.java. You'd just need to modify main()
to call openResource() and modify openResource(,) to print out the place
where it found the .class file.
> I ask it to search my entire hard disk and the contents of all jars
> and report as above.
...and version 2.0 also searches the Internet?
--Mike Amling