105

I have a workspace with a bunch of java projects. If I go to File->Refresh, it doesn't really refresh anything (perhaps the currently selected project). How do I get eclipse to refresh all of the projects?

peterh
  • 9,698
  • 15
  • 68
  • 87
Jack
  • 1,612
  • 3
  • 13
  • 17

7 Answers7

104

It will indeed only refresh the current project (or, more specifically, the current selection in the project explorer). I just click somewhere in the project explorer, do Ctrl+A to select all projects and then press F5 to achieve a complete refresh.

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
  • 7
    Ok, thanks, but note that doing the above in the "Project Explorer" doesn't work (refresh is grayed out), but doing it in the "Package Explorer" it worked fine. – Jack Mar 25 '10 at 19:47
  • 9
    Problem with this is though, that if any of my projects are closed (which is all the time), the Refresh option does not appear. The only way Ctrl+A followed by F5 works for me is if all my projects are open. – Matt Feb 21 '11 at 10:19
  • 10
    @Matt: My Project Explorer is configured to hide closed projects. They are only visible in Navigator. You might want to do the same. – BalusC Feb 21 '11 at 10:23
  • I guess this is the only way? but it is not elegant. requires opening all projects. – Trevor Boyd Smith Jun 10 '11 at 17:07
  • 2
    @Trevor: no as BalusC said you can hide closed projects... again which is not always desirable.. What I ended up doing is actually set "Top Level Elements" to Working Sets which are never closed, so Ctrl+A always works... as well as keeping my workspace more organised..especially with the Dynamic Working Sets plugin(which means no maintenance after setting up some regexes). – inger Jan 04 '12 at 17:01
  • @Matt: I get around this by doing Ctrl+A, then holding Ctrl left-click closed projects to exclude them. Then it works. – user443854 Feb 09 '12 at 14:44
  • 1
    If you go the filter out closed project route, the instructions to do that are here http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jst.j2ee.doc.user%2Ftopics%2Fcjviewfilters.html – Everett Toews Sep 19 '12 at 15:15
  • Note that _ctrl-a_ does not always work in Project explorer, [bug 281966](https://bugs.eclipse.org/bugs/show_bug.cgi?id=281966). Either select (all) items by ctrl/shift or select none, then press F5, as described in other answer(s). – David Balažic Jul 15 '14 at 13:19
  • 1
    This answer of selecting **all** projects in the explorer and hitting _F5_ seems strictly inferior to the answer by @blackburn below, of selecting **none**. Because selecting none will work even if there are closed projects and it will also refresh the workspace itself. – leorleor Feb 17 '15 at 21:22
  • You should collapse all projects in Project Explorer to be able to refresh them. If you have any uncollapsed project and then use `Ctrl + A` to select all, the refresh will be disappear. – Arashsoft Mar 03 '16 at 15:38
  • This crashed my Eclipse. – Noumenon Oct 14 '16 at 14:14
  • 8 years later, I'm using Oxygen and this answer still holds. Thanks much! – Hildy Apr 17 '18 at 04:49
42

If you want to refresh all Projects, ignoring closed projects, then the easiest way is to:

  • ctrl-click and item in the Project Explorer (to ensure the P. Explorer has focus)
  • ctrl-click the item again so that it's no longer highlighted (but the P. Explorer still has focus)
  • F5 will now Refresh the entire workspace

Effectively F5 refreshes the Workspace when a navigation view has focus and nothing is selected.

James Blackburn
  • 4,442
  • 2
  • 23
  • 23
  • 3
    This worked well for me on a Mac substituting cmd-click for ctrl-click – Traveler Sep 10 '14 at 00:20
  • 1
    This is a great workaround for when you have many projects and folders (since ctrl-A right-click doesn't allow refresh if folders are selected) – kotoole Feb 02 '17 at 19:28
15

Ctrl-A, then F5.

You can set up the workspace to automatically refresh when it detects changes in the preferences. (Window > Preferences > General > Workspace > Refresh Automatically)

Mike Daniels
  • 8,402
  • 1
  • 28
  • 44
9

Easy.

  • Create an external tool: Run > External Tools > External Tools Configuration...
  • Create a new Program configuration Point the location to an exe that is very fast (I use Cygwin's 'ls')
  • On the Refresh tab, choose Refresh Resources upon completion, The Entire Workspace
  • On the Build tab, deselect Build before launch

Run the tool to refresh all projects.

Crunch
  • 460
  • 3
  • 8
  • on windows i've used "C:\Windows\twunk_32.exe" doesn't seem to hurt :) – iTake Jan 10 '14 at 12:55
  • How can I know if the refresh is complete? – srrvnn Dec 10 '14 at 19:46
  • This is great! I'm now able to type cmd-3 echo (because I used /bin/echo as the command) and immediately refresh, making it much less of a burden to skip the performance-wrecking autobuilds. Because it gets a menu item, it could also go in a quicksilver trigger or similar setup, so it could be a global keystroke from outside eclipse. – Joshua Goldberg May 29 '15 at 20:02
  • This led me to something even simpler: cmd-3 build all. (posting as an answer) – Joshua Goldberg Jun 01 '15 at 17:30
  • Apologizing for the noise: I've found I have to refresh first and then build. Neither alone is sufficient. (I'd mistakenly thought both actually, that refreshing triggered builds, and that building would start with a refresh. Neither is true.) I use an external tool config with a refresh hook first, and then cmd-3 build all. – Joshua Goldberg Jun 04 '15 at 17:30
6

Control click all your projects together, then right click and hit refresh.

Usually I refresh all like that, then i make sure to clean all projects and rebuild in eclipse.

Felix Khazin
  • 1,448
  • 1
  • 10
  • 16
2

For anyone curious how to select all of those projects on OS X where Ctrl+A doesn't work:

  1. Click the first project
  2. Hold down Shift
  3. Hold the key until they are all selected
  4. Now press F5
Brad
  • 146,404
  • 44
  • 300
  • 476
2

This answer led me to an even simpler solution, no configuration necessary.

Cmd-3 build all (control-3 on windows)

Edit: Correction -- I need to both refresh and build. Build does not automatically refresh. I'm currently using two actions, "echo" from my comment in the linked answer I just referred to (an External Tool configuration with a hook to refresh all), followed by cmd-3 "build all"

Community
  • 1
  • 1
Joshua Goldberg
  • 4,107
  • 1
  • 26
  • 38