Quick Eclipse Tip - "Refresh the file and stop fracking bugging me"

This post is more than 2 years old.

Ok, I love the Eclipse platform, but it has a few... eccentricities that annoy the heck out of me. One of them involves how uppity Eclipse gets if a file is modified by another process. Instead of simply refreshing the file, Eclipse will give you a snooty message and demand you refresh the file. I complained about this on Twitter (is there any other reason to use Twitter) and Steve Good let me know that you can set Eclipse to automatically refresh. Turns out he was exactly right:

Woot. A few notes. First - in my testing, this did not pick up new folders. It did pick up new files in the folders. Secondly - if you have a file open and it's modified, you will not lose the file. In other words, you still get the normal "This file was modified - do you want to load" message. That's a good thing of course. What you won't get is a complaint if you open the file after it was modified by something else.

Anyway - hope this helps other and thanks Steve!

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Archived Comments

Comment 1 by Raymond Camden posted on 6/19/2010 at 8:22 PM

One small note. When I renamed a file in Finder, Eclipse didn't get it _immediately_. It did get it eventually though.

Comment 2 by Drew Wells posted on 6/20/2010 at 4:39 AM

I believe this is the default behavior of Flex Builder. It can slow to a crawl if your project has lots of files.

Comment 3 by Andreas Schuldhaus posted on 6/20/2010 at 1:32 PM

In Eclipse auto-refresh capability ist turned off by default. The problem is that there is no way to do auto-refresh in a platform-neutral way. On platforms that have efficient native support for change notification, it can be quite fast. On other platforms it can be very slow. If you modify files externally on a regular basis, you have to check out, if you want to pay the performance cost. If you do not make external modification, you should leave auto-refresh off and manually hit the refresh button if needed.

Comment 4 by Adam Cameron posted on 6/20/2010 at 10:14 PM

Good tip Ray, cheers.

Looking at that screen in CFB makes me pause for thought... in the context of a ColdFusion project, what does the "build" option actually do? Do you know?


Comment 5 by Raymond Camden posted on 6/21/2010 at 5:00 PM

No idea AC. I'd assume nothing. You go ahead and push that button though and tell me. ;)

Comment 6 by Adam Cameron posted on 6/21/2010 at 5:08 PM

Heh... sounds like you're trying to trick me into doing something I'll regret...


I'll switch it off and see what happens. Or what doesn't happen.

I was really thinking from the perspective of trying to eke out any performance gains possible... CFB's not exactly a rocket in the performance dept.



Comment 7 by Reinhard Jung posted on 8/11/2010 at 4:14 PM

Hi Ray, did you finally found a solution about how to refresh the Browser-View within the cfBuilder? Like it works within cfEclipse. In cfEclipse you just have to press F5.

Comment 8 by Raymond Camden posted on 8/11/2010 at 5:04 PM

Don't you see a refresh icon next to the browser? For me, on the bottom, I see:

Source / Firefox / IE / refreshicondhoohicky

Comment 9 by Reinhard Jung posted on 8/11/2010 at 5:50 PM

Yes, shure. But i have to click it with my mouse?! with F5 i don't have to move my Hands from my Keyboard, which is much faster (F5=1 sec, Mousecklick 3-5). And i do not now how often i do this each day? Is it possible to put/match that Iconclick on a ShortCut?

Comment 10 by Raymond Camden posted on 8/11/2010 at 5:58 PM

Oh - sorry - no idea. I'm the wrong person to ask about keyboard shortcuts. I rarely use em.