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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2030064/
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-08-13 02:47:10  来源:igfitidea点击:

How to run eclipse in clean mode? what happens if we do so?

javaeclipse

提问by GuruKulki

If something is not working properly or some plug-ins are not loaded properly in my Eclipse I often get suggestion to open Eclipse in clean mode.

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

So, how to run in clean mode? And what happens if I do so?

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

采纳答案by Eran Medan

What it does:

它能做什么:

if set to "true", any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.

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

How to use it:

如何使用它:

  • Edit the eclipse.inifile located in your Eclipse install directory and insert -cleanas the first line.
  • Or edit the shortcut you use to start Eclipse and add -cleanas the first argument.
  • Or create a batch or shell script that calls the Eclipse executable with the -cleanargument. The advantage to this step is you can keep the script around and use it each time you want to clean out the workspace. You can name it something like eclipse-clean.bat(or eclipse-clean.sh).
  • 编辑eclipse.ini位于 Eclipse 安装目录中的文件并将其-clean作为第一行插入。
  • 或者编辑用于启动 Eclipse 的快捷方式并将其添加-clean为第一个参数。
  • 或者创建一个批处理或 shell 脚本,用-clean参数调用 Eclipse 可执行文件。此步骤的优点是您可以保留脚本并在每次要清理工作区时使用它。您可以将其命名为eclipse-clean.bat(或eclipse-clean.sh)。

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

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

Other eclipse command line options: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

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

回答by Spike Williams

You can start Eclipse in clean mode from the command line:

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

eclipse -clean

回答by Andreas Dolk

For clean mode: start the platform like

对于清洁模式:像这样启动平台

eclipse -clean

That's all. The platform will clear some cached OSGi bundle information, it helps or is recommended if you install new plugins manually or remove unused plugins.

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

It will not affect any workspace related data.

它不会影响任何与工作区相关的数据。

回答by James Branigan

Using the -cleanoption is the way to go, as mentioned by the other answers.

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

Make sure that you remove it from your .inior shortcut after you've fixed the problem. It causes Eclipse to reevaluate all of the plugins everytime it starts and can dramatically increase startup time, depending on how many Eclipse plugins you have installed.

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

回答by RTA

  • click on short cut
  • right click -> properties
  • add -clean in target clause and then start.
  • 点击快捷方式
  • 右键单击-> 属性
  • 在目标子句中添加 -clean 然后开始。

it will take much time then normal start and it will fresh up all resources.

这将需要很长时间才能正常启动,并且会刷新所有资源。

回答by cristianorbs

For Windows users: You can do as RTA said or through command line do this: Navigate to the locaiton of the eclipse executable then run:

对于 Windows 用户:您可以像 RTA 所说的那样或通过命令行执行以下操作:导航到 eclipse 可执行文件的位置,然后运行:

 eclipse.lnk -clean

First check the name of your executable using the command 'dir' on its path

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

回答by gview

For Mac OS X Yosemite I was able to use the open command.

对于 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.

This worked for me:

这对我有用:

open eclipse.app --args clean

回答by nchouhan

Easier option is to use ./eclipse -clean

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

回答by Neeraj Gahlawat

This will clean the cachesused to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.

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

  1. Open command prompt (cmd)
  2. Go to eclipse application location (D:\eclipse)
  3. Run command eclipse -clean
  1. 打开命令提示符 (cmd)
  2. 转到 eclipse 应用程序位置 (D:\eclipse)
  3. 运行命令 eclipse -clean

回答by Lova Chittumuri

Two ways to run eclipse in clean mode.

在干净模式下运行 eclipse 的两种方法。

1 ) In Eclipse.ini file

1) 在 Eclipse.ini 文件中

  • Open the eclipse.ini file located in the Eclipse installation directory.
  • Add -clean first line in the file.
  • Save the file.
  • Restart Eclipse.
  • 打开位于 Eclipse 安装目录中的 eclipse.ini 文件。
  • 在文件中添加 -clean 的第一行。
  • 保存文件。
  • 重新启动 Eclipse。

enter image description here

在此处输入图片说明

2 ) From Command prompt (cmd/command)

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

  • Go to folder where Eclipse installed.
  • Take the path of Eclipse
  • C:..\eclipse\eclipse.exe -clean
  • press enter button
  • 转到安装 Eclipse 的文件夹。
  • 走Eclipse之路
  • C:..\eclipse\eclipse.exe -clean
  • 按回车键

enter image description here

在此处输入图片说明