Eclipse IDE 中的 -clean 参数是什么意思?

2022-01-16 00:00:00 ide eclipse-plugin eclipse

我读过手动安装一些 Eclipse 插件后,应该使用 -clean 参数来启动 Eclipse.为什么或它有什么作用?

I have read that after installing some Eclipse plugins manually, one should use the -clean parameter to start Eclipse. Why or what does it do?

我还需要做其他事情吗?

Do I have to do something else?

这个问题尤其适用于 Eclipse Galileo 和 Helios.

This question applies to Eclipse Galileo and Helios, in particular.

推荐答案

不,你可以简单地启动eclipse.

No you can simply launch eclipse.

文章保持 eclipse 运行干净"详细介绍了"-clean"选项.

The article "keeping eclipse running clean" details the various usages for "the -clean" option.

修复尘土飞扬的工作区的最简单方法是使用 eclipse.exe 可执行文件的 -clean 命令行参数.让我们看看 Eclipse 帮助文档告诉我们这个命令做了什么:

The easiest way to fix up a dusty workspace is using the -clean command line argument to the eclipse.exe executable. Let's take a look at what the Eclipse help docs tell us this command does:

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

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.

-clean 参数是一次性使用标志,这意味着在您使用它运行 Eclipse 后,您可以将其删除,直到您再次需要它.
如果您更愿意保留它,那么每次使用它的唯一副作用是增加了启动时间(长 2-3 倍),有些人并不介意.

The -clean argument is a one-time use flag, meaning after you have run Eclipse using it, you can remove it until you need it again.
If you prefer to leave it set the only side effect of using it ever time are increased startup times (2-3x longer) which some folks do not mind.

现在,回到上面的描述,这听起来可能并不多,我不得不说你会惊讶于使用 -clean 有时可以解决的问题;一些非常随机的事情.您可以通过三种简单的方式使用此参数:

Now, back to the description above, this may not sound like much, I have to say that you would be amazed at what using -clean can fix up sometimes; some really random things. There are three easy ways you can go about using this argument:

  • 编辑位于 Eclipse 安装目录 中的 eclipse.ini 文件,并将其添加为第一行的第一个参数.
  • 编辑用于启动 Eclipse 的快捷方式并将其添加为第一个参数.
  • 使用 -clean 参数创建一个调用 Eclipse 可执行文件的批处理或 shell 脚本.此步骤的优点是您可以保留脚本并在每次要清理工作区时使用它.您可以将其命名为 eclipse-clean.bat(或 eclipse-clean.sh).
  • Edit the eclipse.ini file located in your Eclipse installation directory and add it as the first argument on the first line.
  • Edit the shortcut you use to start Eclipse and add it as the first argument.
  • Create a batch or shell script that calls the Eclipse executable with the -clean argument. 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).

相关文章