Hi *,
Here is a small program I had created to search for a given .class file within given CLASSPATH.
It is primarily used in our project on test machines where lotsa ppl put lotsa patches in lotsa paths/jars and finally end up wondering which class file is being used.
This tool a tool searches for a given class file in given classpath and it:
- Gives path where the file was found first.
- Gives a list of paths in which file was found.
- Validates all the paths put in your CLASSPATH.
- Works on Unix and Windows.
E.g. :
smlcad@(om2_kash_src)> java FindClass
Usage:
java -cp <classpath-to-search> FindClass <class-to-search>
E.g.
java -cp $CLASSPATH FindClass ca.siemens.tic.smlc.lt.api.rtp.Log
OR
execRTPenv java FindClass ca.siemens.tic.smlc.lt.api.rtp.Log
smlcad@(om2_kash_src)> java FindClass ca.siemens.tic.smlc.lt.api.rtp.Log
Trying to search ca.siemens.tic.smlc.lt.api.rtp.Log
Searching in 1: "." *****
Searching in 2: "/vobs/projects/smlc_src/rtp/java/classes" *****
Searching in 3: "/vobs/devtools/junit3.8.1/junit.jar"
Searching in 4: "/opt/iona"
Searching in 5: "/opt/iona/lib/art/omg/5/omg.jar"
Searching in 6: "/opt/smlc/lib/fwk_intf.jar"
Searching in 7: "/etc/opt/iona/domains/orbixsmlcpt3"
Searching in 8: "/opt/SMAW/SMAWrtpap/libexec/ApacheJServ.jar"
Searching in 9: "/opt/SMAW/SMAWrtpap/libexec/gnujsp10.jar"
Searching in 10: "/opt/SMAW/SMAWrtpap/libexec/servlet-2.0-plus.jar"
Searching in 11: "/opt/SMAW/SMAWrtp/lib/RtpAdmServer.jar"
Searching in 12: "/opt/SMAW/SMAWrtp/lib/RtpAdmGuiJspUtil.jar"
Searching in 13: "/opt/SMAW/SMAWrtp/lib/RtpAdmAppExt.jar" *****
Searching in 14: "/opt/SMAW/SMAWrtp/lib/RtpAdmAppFallback.jar"
Searching in 15: "/opt/SMAW/SMAWrtp/lib/gnu-regexp.jar"
Searching in 16: "/opt/SMAW/SMAWrtp/lib/RtpAudMgr.jar"
Searching in 17: "/opt/SMAW/SMAWrtp/lib/RtpAudRecUtil.jar"
Searching in 18: "/opt/SMAW/SMAWrtp/lib/RtpRecMgr.jar"
Searching in 19: "/opt/SMAW/SMAWrtp/lib/RtpCleanupUpd.jar"
Searching in 20: "/opt/SMAW/SMAWrtp/lib/RtpTcnShow.jar"
Searching in 21: "/opt/SMAW/SMAWrtp/lib/jce1_2_1.jar"
Searching in 22: "/opt/SMAW/SMAWrtp/lib/sunjce_provider.jar"
Searching in 23: "/opt/SMAW/SMAWrtpjr/lib/tools.jar"
Searching in 24: "/export/home/oracle/products/9.2.0/jdbc/lib/classes111.zip"
Searching in 25: "/opt/SMAW/SMAWrtp/lib/RtpAdmAppExt.jar" *****
Results:
Following paths do not exist OR are not readable !
5: "/opt/iona/lib/art/omg/5/omg.jar"
6: "/opt/smlc/lib/fwk_intf.jar"
7: "/etc/opt/iona/domains/orbixsmlcpt3"
19: "/opt/SMAW/SMAWrtp/lib/RtpCleanupUpd.jar"
21: "/opt/SMAW/SMAWrtp/lib/jce1_2_1.jar"
22: "/opt/SMAW/SMAWrtp/lib/sunjce_provider.jar"
23: "/opt/SMAW/SMAWrtpjr/lib/tools.jar"
First found in: 1: "./"
Also found in following 2 path(s):
2: "/vobs/projects/smlc_src/rtp/java/classes/"
13: "/opt/SMAW/SMAWrtp/lib/RtpAdmAppExt.jar"
25: "/opt/SMAW/SMAWrtp/lib/RtpAdmAppExt.jar"
smlcad@(om2_kash_src)>
Known problem:
Doesn't work with ALL versions of Java. If you test of future versions please do comment and let other know the results.