How to auto reload external code changes in Eclipse project

I have started using Sublime text as my preferred code editor (for JS, CSS, Coffee). But, I still rely on Eclipse for writing Java code because it auto-imports Java packages and auto suggests variables and method names from my custom class files.

Working on multiple editors throws in another problem: whenever I make a change in some file outside of Eclipse, the IDE does not silently reload. It shows a blank page saying 'The resource is out of sync. Press F5 to reload'. The message started annoying me soon as I had to switch back and forth often.

It is not just for the multiple editors. Even when I do a git pull, the resources go out of sync.

Then, I found a workaround for this. Eclipse provides a built-in option that auto reloads a resource if its out f sync. Here's how you  can enable it.

Go to **Window -> Preferences -> General -> Workspace **and check the option 'Refresh using native hooks or polling'.

So, the next time when you try to open a out of sync file, the IDE will sync it for you (thus saving you a keystroke, one at a time :) ).

Veerasundar profile photo

Written by Veerasundar

Veerasundar is a Software Engineer, currently working at Salesforce as a Lead Member of Technical Staff. He has over 16 years of industry experience, building consumer facing web applications. He lives in Chennai, India.

Contact Veerasundar: Email or Twitter