Finding a class file in a WAR?

L

laredotornado

Hi,

What is the easiest way to find what JAR file a particular class file
is contained in, if all I have is the WAR file? I only have SSH access
(though a Windows XP PuTTY client) to the Mac OS 10.4 server.

Thanks, - Dave
 
2

2photons

You'll have to extract the jars and then do jar tf on each jar to find
what you want. Use some clever shell command to do that depending on
your shell...you'll have to loop over the jars..

jar xf foo.war WEB-INF/lib/*.jar
for i in `ls *.jar`; do echo $i; jar tf $i | grep myClass.class; done

Something like that - I didn't test it, but you get the idea. If you do
this regularly, put it in a script.

Also, I'm sure there is some cute tool or other than can do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,268
Latest member
AshliMacin

Latest Threads

Top