Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make eclipse "File Search" to also search inside source jars containing some text?

I am working on a (Java) project in which I have many jars which have a source-jar file attached.

Is there any way to make the eclipse "File Search" search for Java files (and txt, xml etc. for that matter) containing some string literal inside these source jars, not just in the project folder?

Or is there any plugin by which this can be achieved?

like image 569
akjain Avatar asked Mar 14 '11 07:03

akjain


People also ask

How do I search inside a file in Eclipse?

If you want to search in files: Ctrl + H and then choose tab File Search . If you want to search for resources: Ctrl + Shift + R . If you want to search for Java types: Ctrl + Shift + T . If you want more shortcut keys: Ctrl + Shift + L .

How do I search for text in Eclipse?

Press Ctrl + H , should bring up the search that will include options to search via project, directory, etc. Ctrl + Alt + G can be used to find selected text across a workspace in eclipse.

How do I view the source code of a jar file in Eclipse?

Or, if this source jar file contains the sources of a classes jar file that is used as a library in your Eclipse project, just right-click on this jar file, select "Properties", then "Java Source Attachment", then "External File", and select the source jar file.


1 Answers

Recently discovered the following plugin has beta support for searching into linked source jars: https://github.com/ajermakovics/eclipse-instasearch

You have to enable searching source jars in the preferences as it is turned off by default. Depending on how much source you have, the indexing process is very slow, but then search is very fast.

I have an Eclipse workspace with the enterprise versions of Alfresco (Explore, Share and SOLR) and Alfresco Workdesk (Vanilla, Office and Mobile). Indexing took about 8 minutes on my Early 2011 MacBook Pro. Search is almost instantanious.

like image 175
user2757811 Avatar answered Sep 29 '22 15:09

user2757811