19

Every time I start Eclipse it tries to refresh an entire project, which translates to more than 10 minutes of wait time, not to mention the ridiculous amount of memory it would consume.

I know there's a global setting to turn off automatic refreshing (General -> Workspace -> Refresh automatically). Is there a way to turn that off on individual directories? The rationale is that some directories are seldom changed in some of my projects.

10 Answers 10

14

According to this thread, no:

  • no settings per projects (for disabling auto-refresh)
  • no settings per directory within one project.

For more recent versions of Eclipse, as detailed in Eclipse help page, you can use Resource filters (also initially mentioned below by pcoucke)

Resource filters can be created, edited and removed in the File > Properties > Resource > Resources Filters property page for a project or folder resource.

Resource filters only apply to files and/or folders that are implicitly included in the workspace by the refresh operation
An "Exclude" resource filter prevent all files and/or folders that match the filter condition to be included in the workspace during the refresh operation.

I mentioned an example in "How to have .git folders ignored by Eclipse projects"

resource filter

2
  • 1
    This sucks. I don't want to close a project just to disable refreshing on some of its directories. Well, hope some future Eclipse will have a fine-grained control over how "refreshing" works. Commented Jun 14, 2009 at 19:58
  • 1
    @Fortepianissimo: true... may be a suggestion to add to bugs.eclipse.org/bugs
    – VonC
    Commented Jun 14, 2009 at 20:32
11

For individual directories you can do it by adding Resource filters.

  1. Right-click a project folder in Project Explorer tree and go to "Properties".
  2. Resource -> Resource Filters.
  3. Add as much exclusion filters for files/folders as you like.

See this answer: https://stackoverflow.com/a/6321688/1194584

3
  • Great, this is the solution, no hack like the other answers. Wondering why I am the first person to vote this up.
    – David L.
    Commented Aug 31, 2013 at 9:46
  • Can confirm this is working. The accepted answer is old and irrelevant
    – Sam
    Commented Jul 1, 2015 at 7:45
  • Great, this saved me Commented Dec 10, 2018 at 22:25
2

If your problem is the refresh on startup, try: Preferences -> General -> Startup and Shutdown -> Refresh workspace on startup.

2

I found an effective hack that can in effect make Eclipse ignore a directory. See Eclipse - Ignore Entire Directories

1

To exclude entire projects, you could close them. Don't know a way for individual directories.

1

I'm sorry but I don't know anything about such a setting. As one already mentioned you could close the project within Eclipse (once it is open). This prevents the repetitive refreshing on that project. Otherwise I can just give you the suggestion to have 1 workspace per project and not include multiple different projects into the same workspace (unless they are related to each other). This is a much better practice and what I'm doing every day when working with Eclipse. And I didn't experience any problems so far of the type you mentioned.

1

I ran in to this same problem. When an eclipse project refreshes it seems to want to touch every file regardless of settings. The code base I'm working on has ~70K files, and took nearly 2 minutes to refresh. I eventually redefined the eclipse project to be a much smaller subset of that (~10K files) that has a ~ 1 second refresh. Not ideal, but the long refresh times are intolerable.

FYI the "Derived" check box and "Exclude from build..." options DON'T prevent a folder from being refreshed.

Note, the computer I'm using is 4-5 years old (Pentium IV processor, 7200 rpm hard drive). I bet one of these newer fast solid state hard drives would dramatically improve refresh times!

1

I found out a way to stop auto refreshing at eclipse startup.Below are the steps:-

Windows->Preferences->(Search Keyword:-Workspace)->General->Startup And ShutDown->Uncheck Referesh workspace on start up.

Done ...!!! Work like charm for me.

0

Edit the file .project inside the folder .metadata.plugins\org.eclipse.jdt.core.org.eclipse.jdt.core.external.folders of your workspace folder.

Then remove any content between the linkedResources tags.

That worked for me (eclipse-jee-helios-SR2-win32)

0

You know what. Just close unused projects and that's was all for me.!

Not the answer you're looking for? Browse other questions tagged or ask your own question.