如果在我的Eclipse中有些东西不能正常工作,或者某些插件没有正确加载,我经常得到建议以干净模式打开Eclipse。

那么,如何在清洁模式下运行呢?如果我这么做了会怎么样?


当前回答

正如其他答案所提到的,使用-clean选项是正确的方法。

确保在解决问题后将其从.ini或快捷方式中删除。它导致Eclipse在每次启动时都要重新评估所有的插件,并且会极大地增加启动时间,这取决于您安装了多少个Eclipse插件。

其他回答

它的作用:

如果设置为“true”,则使用任何缓存的数据 通过OSGi框架和eclipse 运行时将被擦干净。这将 清理用于存储bundle的缓存 依赖项解析和eclipse 扩展注册表数据。使用这个 选项将强制eclipse到 重新初始化这些缓存。

如何使用:

编辑位于Eclipse安装目录中的Eclipse .ini文件,并将-clean作为第一行插入。 或者编辑用于启动Eclipse的快捷方式,并添加-clean作为第一个参数。 或者创建一个批处理或shell脚本,使用-clean参数调用Eclipse可执行文件。此步骤的优点是您可以保留脚本,并在每次希望清理工作区时使用它。您可以将其命名为eclipse-clean.bat(或eclipse-clean.sh)。

(来自http://www.eclipsezone.com/eclipse/forums/t61566.html):

其他eclipse命令行选项:http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

正如其他答案所提到的,使用-clean选项是正确的方法。

确保在解决问题后将其从.ini或快捷方式中删除。它导致Eclipse在每次启动时都要重新评估所有的插件,并且会极大地增加启动时间,这取决于您安装了多少个Eclipse插件。

Windows用户: 你可以像RTA说的那样,或者通过命令行这样做: 导航到eclipse可执行文件的位置,然后运行:

 eclipse.lnk -clean

首先在可执行文件的路径上使用'dir'命令检查可执行文件的名称

这将清除用于存储包依赖项解析和eclipse扩展注册表数据的缓存。使用此选项将强制eclipse重新初始化这些缓存。

打开命令提示符(cmd) 转到eclipse应用程序位置(D:\eclipse) 执行命令eclipse -clean

对于Mac OS X Yosemite,我可以使用open命令。

Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
Options: 
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.

这招对我很管用:

open eclipse.app --args clean