如何在干净模式下运行eclipse?如果我们这样做会发生什么?

Gur*_*lki 194 java eclipse

如果某些东西工作不正常或者我的Eclipse中正确加载了一些插件.我经常建议以干净模式打开Eclipse.那么,如何在干净模式下运行?如果我这样做会怎么样?

Era*_*dan 264

它能做什么:

如果设置为"true",则OSGi框架和eclipse运行时使用的任何缓存数据都将被清除.这将清除用于存储bundle依赖项解析和eclipse扩展注册表数据的缓存.使用此选项将强制eclipse重新初始化这些缓存.

如何使用它:

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

  • 我建议(2)使用clean选项创建一个'第二个'eclipse快捷方式.您不希望它出现在eclipse.ini文件中,因为这会禁用有用的OSGi缓存并增加eclipse启动时间.只有在您觉得必须时才使用. (33认同)
  • @SpaceRocker - 我为什么要这样?推荐任何你喜欢的.我一直推荐"2"的变体,这是"日食清洁"的第二个快捷方式(对于Windows环境,当然) (4认同)
  • @Andreas_D,所以基本上你应该推荐(3) (3认同)
  • 我编辑了你的帖子,因为我错误地投了反对票,这是对你的帖子投赞成票(删除空行)的唯一可能性。很抱歉这个微不足道的变化,但投票被锁定。 (2认同)
  • 虽然“-clean”参数在某些情况下可能会有所帮助,但它绝对并不总是有效。对于我们来说,删除“.../configuration/org.eclipse.core.runtime”文件夹(其中还有 3 个“org.eclipse.xxx”文件夹)就可以解决问题(基于 eclipse e4 的应用程序)。 (2认同)

And*_*s_D 77

对于清洁模式:启动平台就好

eclipse -clean
Run Code Online (Sandbox Code Playgroud)

就这样.该平台将清除一些缓存的OSGi包信息,如果您手动安装新插件或删除未使用的插件,它会有所帮助或建议使用.

它不会影响任何工作区相关数据.

  • 喜欢它不会改变工作区数据的信息! (3认同)

Spi*_*ams 33

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

eclipse -clean
Run Code Online (Sandbox Code Playgroud)


小智 16

-clean如其他答案所述,使用该选项是可行的方法.

.ini修复问题后,请确保将其从快捷方式或快捷方式中删除.它会导致Eclipse在每次启动时重新评估所有插件,并且可以显着增加启动时间,具体取决于您安装的Eclipse插件数量.


RTA*_*RTA 12

  • 点击捷径
  • 右键单击 - >属性
  • 在target子句中添加-clean然后启动.

这将需要很长时间,然后正常启动,它将新鲜所有资源.


gvi*_*iew 6

对于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.
Run Code Online (Sandbox Code Playgroud)

这为我工作:

open eclipse.app --args clean
Run Code Online (Sandbox Code Playgroud)


小智 5

更简单的选择是使用 ./eclipse -clean