I have a jar file containing so many *.class files. I need to SEARCH one method (i just have the method name alone with me now) in which class file.
Is it possible ?
I have a jar file containing so many *.class files. I need to SEARCH one method (i just have the method name alone with me now) in which class file.
Is it possible ?
You can use the following steps to find all class names that include the target method name in the Jar file.
Use the above steps, we can find all the class names in the jar file with a specified target method name.
I wrote a code and ran an example for finding class name in jar 'commons-lang-2.4.jar' with target method name 'removeCauseMethodName'.
And the following message is displaying in console.
Method [removeCauseMethodName] is included in Class [org.apache.commons.lang.exception.ExceptionUtils]
From the message, we can see the class name, which includes the target method name.
The code is as follows:
Note: before running the code, we need to add jar 'commons-lang-2.4.jar' to the build path.
Hope this can help you some.
Extract the class from jar file and then run
The
classes.txt
file will have all information about the classes inside jar. You can search it for a method.You can see the
method declaration
[But not the source code] inEclipse IDE
. OpenPackage Explorer --> Referenced libraries
[which are referenced in your project] then expand the tree for the jar which you want to see the classes. In theoutline
window, you can see the method declarationYou can open the jar in winzip/winrar and decompile the class file into java file. There are multiple decompilers available on net