6

I have a Java Maven project in Eclipse so all the Maven artifact jar files are listed in the "Maven Dependencies" package (folder?) in the Project Explorer. I would like to do a simple text search inside the *.class files inside the jars the same way I do a file containing text search. I can't use *.class directly in File name patterns field in Eclipse File search and if I use *.jar that will return binary results.

Was actually a bit surprised not to find answer to this so maybe I am missing something?

Eugene S
  • 6,709
  • 8
  • 57
  • 91

1 Answers1

6

If you want to search for some text in some jar file, you need to select Java Search Tab. Press CTRL+H to see the screen bellow.

Search Dialog

Note that I'm searching in Application libraries as well.

In the image bellow you can see the result of my search.

Search REsult

And finally, the reference in code inside of jar file.

Result in Jar File

I hope it helps you.

josivan
  • 1,963
  • 1
  • 15
  • 26
  • 2
    Thanks! It is helpful. I didn't have my "Java Search" tab enabled in Eclipse so didn't see all these options. But can you search without limiting yourself by Type, Method, Package, etc.. Can you search for text anywhere in the *.class files (inside the jar). – Eugene S Apr 01 '16 at 03:34
  • 1
    You mean a kind of full search? I'm not sure, I have never tried to do it. Generally when I need to search some text as properties, tag, xsd, etc. I do it opening manually in META-INF. Its a good question. Sorry for didn't answer it. Take a look in [this](http://stackoverflow.com/questions/5295889/how-to-make-eclipse-file-search-to-also-search-inside-source-jars-containig-so) answer – josivan Apr 01 '16 at 03:43