Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Eclipse refresh resources automatically?

Tags:

eclipse

ide

pydev

People also ask

How do I refresh in Eclipse?

When a new file is created in Eclipse you might need to refresh the Eclipse project to see the new file. This refresh process can take place automatically. To set auto-refresh, go to window → preferences → general → workspace and check the "Refresh using native hooks or polling" check-box.

How do you refresh a project programmatically in Eclipse?

To refresh all projects in a workspace, simply enumerate all projects using ResourcesPlugin. getWorkspace(). getRoot(). getProjects() API and refresh each in turn.

How do you refresh a Java project?

Use : Window->Preferences-> General -> Workspace and check Refresh using native hooks and polling checkbox.


This issue will be fixed in Eclipse 3.7 (Indigo). While "Refresh Automatically" does eventually bring resources back into sync, the refresh hook only exists for Windows, so on Linux and Mac OS it has to poll the filesystem periodically.

From 3.7 there's a new preference Settings > General > Workspace > Refresh On Access (aka Lightweight Refresh). This preference causes Eclipse to automatically refresh resources when it discovers that they're 'out-of-sync'. When opening, reading or searching files, it'll prevent out-of-sync errors from occurring.

See also: https://bugs.eclipse.org/303517


I think if you click on the project node in the Project Explorer and press F5 or right click and select Refresh, all resources for that project will be refreshed. Also, if you CTRL+click on multiple projects, you should be able to refresh multiple projects at the same time.

A single click on a project, a CTRL+A to select everything, and an F5 should do exactly what you need - refresh everything.

I'll have to test this when I get the chance, but I believe this is how I overcame similar problems in the past.


I've noticed that this answer routinely is getting down voted. I'd like to point out that the question refers to a specific version of Eclipse: 3.4.2. There was actually no automatic method to refresh out-of-sync resources until version 3.7 Indigo of Eclipse, as mentioned in James Blackburn's answer. The method described in this answer is the only method to achieve this in version 3.4.2 (and any other version before 3.7 Indigo).


Out of synchronization problem is common in eclipse IDE so you have to check this option windows -> preference -> Workspace -> refresh using native hooks or polling.


Eclipse Helios possesses a built in refresh feature at Preferences > General > Workspace. It's in the same spot where you disable automatic builds. Select refresh automatically. A plugin with the same functionality is Andrei Loskutov's Filesync Plugin. The update site address is: http://andrei.gmxhome.de/eclipse/. During installation, select Eclipse 3.5-3.7 plugins > FileSync.


Given that Java 7 has an api for filesystem hooks, one would think that refresh could be handled better in Eclipse.

Edit: Actually, there is a plugin that uses this mechanism: https://github.com/psxpaul/EclipseJava7Refresher


There is a global refresh - have nothing (or everything) selected in the package explorer and press F5 (or right-click on empty space and select Refresh). Of course, this could take rather long if you have large projects.


The global refresh actually exists in plain Eclipse without any plugins and without selecting every project in your workspace.

Basically you need to deselect everything in your project explorer and hit F5. To do that Ctrl+click the selected resource in the project explorer and hit F5.