views:

28

answers:

2

I am trying to look at the method members of a class within a jar file. Currently to list all the classes within a jar file, one can call this command:

jar -tf myjar.jar but if i want to list the public methods within a particular class in this jar file, How do i go about it. Thanks

A: 

One way would be via the javap JDK command.

McDowell
A: 

I've quickly just hacked this together. Works in Bash/UNIX - I know you tagged this with Dos so probably wanted that, sorry:

export CLASSPATH=<JAR>
jar tvf <JAR> | awk '{print $8}' | grep class$ | sed 's/\.class$//' | xargs javap

Where <JAR> is the name of the jar you want to examine.

Noel M