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

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


当前回答

您可以从命令行以clean模式启动Eclipse:

eclipse -clean

其他回答

它的作用:

如果设置为“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

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

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

您可以从命令行以clean模式启动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

在清洁模式下运行eclipse的两种方法。

1)在Eclipse.ini文件中

打开Eclipse安装目录中的Eclipse .ini文件。 在文件中添加-clean第一行。 保存文件。 重新启动Eclipse。

2)从命令提示符(cmd/ Command)

转到安装Eclipse的文件夹。 以Eclipse为例 C: . . \ eclipse \ eclipse.exe抹杀的 按回车键