Eclipse IDE 中的 -clean 参数是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3430295/
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
What does the -clean parameter mean in the Eclipse IDE?
提问by user310291
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?
我读到手动安装一些 Eclipse 插件后,应该使用该-clean
参数来启动 Eclipse。为什么或它做什么?
Do I have to do something else?
我还需要做些什么吗?
This question applies to Eclipse Galileo and Helios, in particular.
这个问题特别适用于 Eclipse Galileo 和 Helios。
回答by VonC
No you can simply launch eclipse.
不,您可以简单地启动日食。
The article "keeping eclipse running clean" details the various usages for "the -clean" option.
“保持 Eclipse 运行干净”一文详细介绍了“-clean”选项的各种用法。
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:
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.
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.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:
- Edit the eclipse.ini file located in your Eclipse installation directoryand 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).
修复尘土飞扬的工作区的最简单方法是对 eclipse.exe 可执行文件使用 -clean 命令行参数。让我们看看 Eclipse 帮助文档告诉我们这个命令的作用:
如果设置为“true”,则 OSGi 框架和 eclipse 运行时使用的任何缓存数据都将被清除。这将清理用于存储包依赖解析和 Eclipse 扩展注册表数据的缓存。使用此选项将强制 eclipse 重新初始化这些缓存。
该
-clean
参数是一次性使用标志,这意味着在您使用它运行 Eclipse 之后,您可以将其删除,直到再次需要它为止。
如果你更愿意让它设置,那么使用它的唯一副作用是启动时间增加(2-3 倍长),有些人不介意。现在,回到上面的描述,这听起来可能并不多,我不得不说你会惊讶于使用 -clean 有时可以解决什么问题;一些非常随机的事情。您可以通过三种简单的方法使用此参数:
- 编辑位于Eclipse 安装目录中的 eclipse.ini 文件,并将其添加为第一行的第一个参数。
- 编辑用于启动 Eclipse 的快捷方式并将其添加为第一个参数。
- 创建一个批处理或 shell 脚本,使用 -clean 参数调用 Eclipse 可执行文件。此步骤的优点是您可以保留脚本并在每次要清理工作区时使用它。您可以将其命名为 eclipse-clean.bat(或 eclipse-clean.sh)。
回答by Gilbert Le Blanc
If you're developing Eclipse plug-ins, you want to use the -clean
parameter on the Eclipse application you start to test your plug-ins.
如果您正在开发 Eclipse 插件,您希望使用-clean
您开始测试插件的 Eclipse 应用程序上的参数。
Otherwise, as VonC already answered, -clean
is a one-time use flag, meaning after you have run Eclipse using it, you can remove it until you need it again.
否则,正如 VonC 已经回答的那样,-clean
是一次性使用标志,这意味着在您使用它运行 Eclipse 后,您可以将其删除,直到再次需要它为止。