Eclipse:如何刷新整个工作区?F5 不行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2518428/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:17:05  来源:igfitidea点击:

Eclipse: How do i refresh an entire workspace? F5 doesn't do it

eclipserefreshworkspace

提问by Hyman

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 allof the projects?

我有一个包含一堆 Java 项目的工作区。如果我去File->Refresh,它并没有真正刷新任何东西(也许是当前选择的项目)。如何让 eclipse 刷新所有项目?

采纳答案by BalusC

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+Ato select all projects and then press F5to achieve a complete refresh.

它确实只会刷新当前项目(或者更具体地说,项目资源管理器中的当前选择)。我只需单击项目资源管理器中的某处,执行Ctrl+A以选择所有项目,然后按F5以实现完全刷新。

回答by James Blackburn

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

如果要刷新所有项目,忽略已关闭的项目,那么最简单的方法是:

  • ctrl-clickand item in the Project Explorer (to ensure the P. Explorer has focus)
  • ctrl-clickthe item again so that it's no longer highlighted (but the P. Explorer still has focus)
  • F5will now Refresh the entire workspace
  • ctrl-click和 Project Explorer 中的项目(以确保 P. Explorer 具有焦点)
  • 再次按住 ctrl 并单击该项目,使其不再突出显示(但 P. Explorer 仍具有焦点)
  • F5现在将刷新整个工作区

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

当导航视图具有焦点且未选择任何内容时,F5 会有效地刷新工作区。

回答by Mike Daniels

Ctrl-A, then F5.

Ctrl-A,然后 F5。

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

您可以将工作区设置为在检测到首选项更改时自动刷新。(窗口 > 首选项 > 常规 > 工作区 > 自动刷新)

回答by Crunch

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
  • 创建外部工具:运行 > 外部工具 > 外部工具配置...
  • 创建一个新的程序配置将位置指向一个非常快的exe(我使用Cygwin的'ls')
  • 在“刷新”选项卡上,选择“完成后刷新资源”、“整个工作区”
  • 在 Build 选项卡上,取消选择 Build before launch

Run the tool to refresh all projects.

运行该工具以刷新所有项目。

回答by Felix Khazin

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.

通常我会像这样刷新所有内容,然后确保清理所有项目并在 Eclipse 中重建。

回答by Joshua Goldberg

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

这个答案让我找到了一个更简单的解决方案,不需要配置。

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

Cmd-3 全部编译(windows 上的 control-3)

Edit:Correction -- I need to bothrefresh andbuild. 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"

编辑:更正-我需要两个刷新构建。构建不会自动刷新。我目前正在使用两个操作,“echo”来自我刚刚提到的链接答案中的评论(带有用于刷新所有内容的挂钩的外部工具配置),然后是 cmd-3“全部构建”

回答by Brad

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

对于任何好奇如何在 OS X 上选择所有这些项目的人,其中Ctrl+A不起作用:

  1. Click the first project
  2. Hold down Shift
  3. Hold the key until they are all selected
  4. Now press F5
  1. 点击第一个项目
  2. 按住 Shift
  3. 按住键直到它们都被选中
  4. 现在按 F5