Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude .class files from file search in Eclipse?

I want eclipse to ignore all .class files when I search for a keyword in files. I don't want a particular directory to be excluded, instead I want to exclude all files of type .class

like image 668
Nevin Avatar asked Feb 08 '23 23:02

Nevin


2 Answers

when you open the File Search in Eclipse, there is a text box for filename patterns. You can enter the patterns you DO want to include, like *.java, *.xml, etc. (each pattern separated by a comma) , and it will only search in files of that type.

EDIT: To exclude a file type, place an exclamation mark in front of the pattern, like

!*.class, !*.svn
like image 157
gariepy Avatar answered Feb 11 '23 15:02

gariepy


I managed to exclude files of a specific extension in eclipse using resource filters:

  • Right-click on the project in project explorer -> select properties
  • Expand the Resource heading on the left of the properties window and select Resource filters
  • Select the Add Filter button

In my scenario, I was ignoring tar.gz archives:

enter image description here

So in this example *.class could have been inputted rather than *.tar.gz to ignore all files with the class extension.

like image 36
Richard Pursehouse Avatar answered Feb 11 '23 15:02

Richard Pursehouse