Thursday, November 11, 2004

javap and classpath resolution

Having a heck of a time trying to get javap to spit out correct info
for a class that's contained in many jars--it was spitting out the
same thing for each class in the jar (from my script that searches
through the jars for a particular class). After about 10 minutes of
frustration and figuring this out I went to the web and found this:
http://www.ecst.csuchico.edu/~amk/foo/java2tools.html. So, no thanks
to the man page for javap. If the class on which you are invoking
javap resides with the JDK, it'll ALWAYS be decompiled from the JDK
entry. What you need to do is add "-bootclasspath ." to the command
line so that you bootclasspath gets reassigned (to something you don't
care about) to your local dir. Glad this didn't waste too much more
time. Once I get the script completed I'll post it.

No comments: