How do I hide .class files from the Open Resource dialog in Eclipse?
Exclude .class
files swiftly in Eclipse:
- Use
Ctrl
+Shift
+R
to bring up Open Resource. - Click the arrow, top-right, for View Menu.
- Select Filters... and tick "*.class".
- Click OK to activate.
Your .class
files are now camouflaged in search results.
The .class hide-n-seek: Strategies revealed!
While managing the visibility of .class files, we'll uncover key strategies: Using the Derived
attribute, the Resource Filters
, and Working Sets
.
Using 'Derived' as file invisibility cloak
Marking your root or specific output folders as Derived to hide like Harry Potter!
Eclipse now understands these files aren't primary source files, and voila, they're hidden in your searches.
Resource Filters: Your guardian against clutter
Project-specific Resource Filters sweeps .class
files under the rug:
Tailoring .class visibility with Working Sets
Optimize search speed in large projects, by befriend Working Sets:
Categorize and manage resources with Java Main Source and Java Test Source working sets for a more organized living.
Customizing Eclipse: For each project, its own
Tailor-fit Eclipse settings for the divergent needs of different projects.
Optimizing for large projects
For Titanic-sized codebases:
- 'Resource Filters' for swift navigation.
- Exclude build directories like 'bin/', 'build/' or 'target/'.
- Working Sets allows custom searches focused on source and test directories.
Sweeping directory-specific clutter under the rug
When you need to handle directories:
- Under 'Resource Filters', select 'Exclude all' and 'Folders'.
- Specify pathnames such as 'bin/' or 'target/'.
This helps you focus on the important stuff and navigate more cleanly.
Consistency across workspaces
While a universal .class hiding option for all workspaces isn’t available, your customized settings can be reused in new projects. This way, you enjoy a standardized yet customized IDE experience.
Was this article helpful?