It's not a secret anymore!
The moose likes Java in General and the fly likes javap  and jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "javap  and jar files" Watch "javap  and jar files" New topic

javap and jar files

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
I have a jar file. I would like to know all the method names with their signatures in all the classes present in the jar file.

javap.exe utility helps me to some extent, but it seems to be working only
on a single class file.

Is there a tool that works like javap but works on a complete jar file or a package?
Nikhil Menon
Ranch Hand

Joined: Nov 22, 2004
Posts: 70
You can use DJ Java Decomplier instead.
It decompiles all your class files.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

On GNU/ Linux, I can use:

for my archiv 'jruler.jar'.
'grep' and 'sed' are available for windows too.
And a powerfull commandshell (sh.exe).

The expression $(x) returns the result of the command x, which is, in this case, the result of a pipe.
a) the well known jar.
b) grep, to filter out Manifest, images and other stuff
c) sed, to strip off the fileextension '.class'

I don't know whether there is a native $(x)-equivalent on windows, but perhaps you aren't using windows at all... ?
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
Nikhil: I am not interested in the complete source code.
Only the list of classes and their exposed methods. JavaDocs would have perfect, but
We do not have access to the source code. Moreover the number of classes is more.

Stefan: Thanks for the Unix Update. But we are using Windows 2K.
I will try to see if I can find equivalent commands in NT Scripting Language.
I agree. Here's the link:
subject: javap and jar files
It's not a secret anymore!