Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

Finding a class file in a WAR?

Thread view: 
laredotornado@gmail.com - 02 Jan 2007 23:07 GMT
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
2photons@gmail.com - 02 Jan 2007 23:51 GMT
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.

> Hi,
>
[quoted text clipped - 3 lines]
>
> Thanks, - Dave
2photons@gmail.com - 03 Jan 2007 00:28 GMT
I believe you'll have to do   "ls WEB-INF/lib/*.jar" instead of "ls
*.jar"

2phot...@gmail.com wrote:
> 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
[quoted text clipped - 15 lines]
> >
> > Thanks, - Dave


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.