eclipse 反复出现的日食挂
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8902338/
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
Recurring eclipse hanging
提问by Eric G
I use eclipse to do php development. I recently developed an issue where the IDE would hang, and immediately return to hanging whenever I opened eclipse. It said it was hanging on "Initializing Java Tooling. I reinstalled java and eclipse in multiple editions. I deleted my workspace. I finally deleted the workspace and did a new checkout of my project, at with point it started working again.
我用eclipse做php开发。我最近开发了一个问题,IDE 会挂起,并在我打开 eclipse 时立即恢复挂起。它说它挂在“初始化 Java 工具。我在多个版本中重新安装了 java 和 eclipse。我删除了我的工作区。我终于删除了工作区并对我的项目进行了新的检查,此时它又开始工作了。
Okay, so something screwed up in the project. Fine. I got it resetup, created a few files I need to run the project from the development directory using a local server (.user.ini and a php files), and was able to run it and make a couple changes. Everything working. I was adding a couple of files and noticed that the files I had manually created weren't showing in the package explorer, so I refresh at the root level and.... it hangs.
好吧,项目出了点问题。美好的。我重置了它,创建了一些我需要使用本地服务器(.user.ini 和 php 文件)从开发目录运行项目的文件,并且能够运行它并进行一些更改。一切正常。我添加了几个文件并注意到我手动创建的文件没有显示在包资源管理器中,所以我在根级别刷新......它挂起。
I eventually kill the app and on relaunch I can still work with the one file I had open, but whenever I reopened the project directory it hung. I deleted the workspace and tried to recreate the project from the existing source, but after entering the source directory and hitting next, it hangs.
我最终终止了该应用程序并在重新启动时我仍然可以使用我打开的一个文件,但是每当我重新打开项目目录时它就会挂起。我删除了工作区并尝试从现有源重新创建项目,但在进入源目录并点击下一步后,它挂起。
Am I doing something to the project directories that would cause eclipse to hang?
我是否对项目目录做了一些会导致 eclipse 挂起的事情?
采纳答案by Eric G
Turns out the problem was that eclipse was processing the sessions directory which I had configured to exist within the projects root directory. Anytime I refreshed the tree it processed all the sessions files which apparently was enough to take 10+ minutes. Weird.
原来问题是 eclipse 正在处理我配置为存在于项目根目录中的会话目录。每当我刷新树时,它都会处理所有会话文件,这显然足以花费 10 分钟以上的时间。奇怪的。
After telling eclipse to exclude it, all is well again.
在告诉 eclipse 排除它之后,一切又好了。
Update:
更新:
If you're having the same problem I had, then in eclipse you should be able to see a directory that is full of hundreds or thousands of text files. Eclipse will try to process them. To tell it not to, right click on the project, then click properties -> resource -> resource filters
. Add an exclude all rule where the name matches the folder name. You may also want to do this for any .svn folders or the like.
如果您遇到了与我相同的问题,那么在 eclipse 中您应该能够看到一个包含成百上千个文本文件的目录。Eclipse 将尝试处理它们。要告诉它不要,请右键单击该项目,然后单击properties -> resource -> resource filters
。添加名称与文件夹名称匹配的排除所有规则。您可能还想对任何 .svn 文件夹等执行此操作。
回答by bhaskarc
First try to clean your project and see if it solves the issue for you.
首先尝试清理您的项目,看看它是否为您解决了问题。
if not take a backup of .metadata folder(just in case you need to revert back) and delete the following directory:
如果不备份 .metadata 文件夹(以防万一您需要恢复)并删除以下目录:
YOUR_WORKSPACE_HOME/.metadata/.plugins/org.eclipse.core.resources/.project
YOUR_WORKSPACE_HOME/.metadata/.plugins/org.eclipse.core.resources/.project
or
或者
YOUR_WORKSPACE_HOME/.metadata/.plugins/org.eclipse.core.resources/.projects
YOUR_WORKSPACE_HOME/.metadata/.plugins/org.eclipse.core.resources/.projects
restart Eclipse problem should be solved.
重启Eclipse问题应该就解决了。
it solved things for me after wasting several hours on other solutions..
在其他解决方案上浪费了几个小时后,它为我解决了问题..
回答by newbieProgrammer
For me, I fixed it by granting eclipse administrator rights and starting eclipse in cmd with:
对我来说,我通过授予 eclipse 管理员权限并在 cmd 中启动 eclipse 来修复它:
eclipse.exe -clean -clearPersistedState
回答by Robert
If you want help, go into your workspace, and look for the .metadata directory, then get the .log file and upload it. You might have better luck getting responses from the Eclipse forums - http://www.eclipse.org/forums/index.php/f/85/
如果您需要帮助,请进入您的工作区,查找 .metadata 目录,然后获取 .log 文件并上传它。您可能会更幸运地从 Eclipse 论坛获得回复 - http://www.eclipse.org/forums/index.php/f/85/
My best guess is that there is some plugin that is causing problems, and storing state somewhere in the .metadata directory, but without a lot more information I can't tell what. I have been doing PHP development in Eclipse, and I have not had this type of problem, although I did run into something similar with some really screwy SVN settings I once tried.
我最好的猜测是有一些插件导致了问题,并将状态存储在 .metadata 目录中的某处,但没有更多信息,我不知道是什么。我一直在 Eclipse 中进行 PHP 开发,我没有遇到过这种类型的问题,尽管我确实遇到过类似的问题,我曾经尝试过一些非常棘手的 SVN 设置。
回答by John Rix
I've been having somewhat related problems with Eclipse for a few weeks now. In my case, I am trying to work on a PHP project on a PC and Mac and was finding Eclipse becoming very sluggish and then hanging completely on a regular basis on both machines. This behaviour seemed to be particularly bad when working on JavaScript files, but it was not limited to this. I tried various releases of Eclipse as well as 32 and 64 bit editions and could not get around it.
几个星期以来,我一直遇到一些与 Eclipse 相关的问题。就我而言,我正在尝试在 PC 和 Mac 上处理 PHP 项目,并且发现 Eclipse 变得非常缓慢,然后在两台机器上定期完全挂起。在处理 JavaScript 文件时,这种行为似乎特别糟糕,但不仅限于此。我尝试了各种版本的 Eclipse 以及 32 和 64 位版本,但无法绕过它。
Ultimately, deleting the project (.project, .settings, .buildpath) and re-creating it seems to have solved the problem for me. (Note, my project is not stored in my workspace folder but elsewhere on a network drive.)
最终,删除项目(.project、.settings、.buildpath)并重新创建它似乎解决了我的问题。(注意,我的项目没有存储在我的工作区文件夹中,而是存储在网络驱动器的其他地方。)
I know this isn't a direct answer to the above question and this question is a bit old now, but the title is consistent with what I experienced, so I'm throwing this out there in case anybody else stumbles upon it in a dark hour!
我知道这不是上述问题的直接答案,这个问题现在有点老了,但标题与我所经历的一致,所以我把它扔在那里,以防其他人在黑暗中偶然发现它小时!
回答by Malcolm Boekhoff
Not sure where to post this: there needs to be a generic "Eclipse Hanging" thread!
不知道在哪里发布这个:需要一个通用的“Eclipse Hanging”线程!
My issue was Eclipse hanging (on Windows) after a time ranging from a few moments to a few minutes after start-up.
我的问题是 Eclipse 在启动后几分钟到几分钟后挂起(在 Windows 上)。
Looking at the log file, "workspace.metadata.log", only pointed me in the wrong direction (removing random plugins pointed to by stack traces).
查看日志文件“workspace.metadata.log”,只会将我指向错误的方向(删除堆栈跟踪指向的随机插件)。
I could have saved myself a lot of trouble by looking first at EventVwr, because it turned out to be a permissions problem in:
我可以通过先查看 EventVwr 来为自己省去很多麻烦,因为结果证明是以下方面的权限问题:
"%USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache"
Here is the error that appears in EventVwr:
这是出现在 EventVwr 中的错误:
taskhost (2404) WebCacheLocal: An attempt to open the file
"C:\Users\Malcolm.Boekhoff\AppData\Local\Microsoft\Windows\WebCache\V01.chk"
for read / write access failed with system error 5 (0x00000005): "Access is denied. ".
The open file operation will fail with error -1032 (0xfffffbf8).
Specifically, check the permissions on the "V01.log" file:
具体来说,检查“V01.log”文件的权限:
icacls "%USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache" /T
Fix it by adding yourself with full access:
通过添加自己的完全访问权限来修复它:
icacls "%USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache" /T /Q /C /GRANT "%USERDOMAIN%\%USERNAME%:F"
Further reading:
进一步阅读:
Here is the embarrassing list of time wasters that I tried thanks to Google. None of them worked:
这是我在谷歌的帮助下尝试过的令人尴尬的浪费时间的清单。他们都没有工作:
- Disable: "Code Recommendations"
- Disable: "General"."Notifications" (used to be under "Mylyn")
- Disable: "Install/Update"."Automatic Updates"
- Disable: "Java"."Code Coverage"
- Disable: "News": "Preferences"."General"
- Remove the "org.eclipse.rse.*.jar" files, except for "org.eclipse.rse.shells.ui_3.0.500.201403271554.jar", from the "plugins" directory.
- Remove all maven jars
- Remove all gradle jars
- Specify: "-Declipse.log.level=ALL" in VM args (I think I forgot to also specify "-debug")
- etc.
If anyone is interested, here is my eclipse command line:
如果有人感兴趣,这是我的 eclipse 命令行:
start "eclipse" /max "c:\eclipse-jee-oxygen-1a-win32-x86_64\eclipse\eclipse" -nosplash -clean -consoleLog -debug -data "c:\eclipse-jee-oxygen-1a-win32-x86_64\workspace" -product "org.eclipse.epp.package.jee.product" -vm "c:/Program Files/Java/jdk1.8.0_121/bin/java" "-vmargs" "-Declipse.log.level=ALL" "-Xmx2048m"
Here is the java console log that you see when you use "bin/java" (as above) instead of "bin/javaw":
这是您在使用“bin/java”(如上)而不是“bin/javaw”时看到的 java 控制台日志:
Install location:
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/
Configuration file:
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/configuration/config.ini loaded
Configuration location:
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/configuration/
Framework located:
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/plugins/org.eclipse.osgi_3.12.50.v20170928-1321.jar
Loading extension: reference:file:org.eclipse.osgi.compatibility.state_1.1.0.v20170516-1513.jar
eclipse.properties not found
Framework classpath:
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/plugins/org.eclipse.osgi_3.12.50.v20170928-1321.jar
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/plugins/
file:/c:/eclipse-jee-oxygen-1a-win32-x86_64/eclipse/plugins/org.eclipse.osgi.compatibility.state_1.1.0.v20170516-1513.jar
Debug options:
file:/c:/mcb/religare/work/.options not found
Time to load bundles: 32
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry aft
er the state location is initialized.
Starting application: 5075
org.eclipse.m2e.logback.configuration: Logback config file: C:\eclipse-jee-oxygen-1a-win32-x86_64\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configura
tion\logback.1.8.2.20171007-0217.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://1008.fwk985397764:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://1008.fwk985397764:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Application Started: 10507
# !SESSION 2017-10-20 13:07:49.562
# version: 1.1
# verbose: true
# The following option strings are specified for this debug session:
| main | 2017-10-20 13:07:49.562 | org.eclipse.e4.ui.workbench | /debug | org.eclipse.e4.ui.internal.workbench.WorkbenchLogger | trace | 158 | Ignored attempt t
o set focus during set focus for: org.eclipse.ui.internal.e4.compatibility.CompatibilityView@23f31375 |
Also, using "-debug", you get a file, "trace.log" in the .metadata directory (but no ".log" file, even with "ALL"):
此外,使用“-debug”,您会在 .metadata 目录中获得一个文件“trace.log”(但没有“.log”文件,即使使用“ALL”):
# !SESSION 2017-10-20 13:07:49.562
# version: 1.1
# verbose: true
# The following option strings are specified for this debug session:
| main | 2017-10-20 13:07:49.562 | org.eclipse.e4.ui.workbench | /debug | org.eclipse.e4.ui.internal.workbench.WorkbenchLogger | trace | 158 | Ignored attempt to set focus during set focus for: org.eclipse.ui.internal.e4.compatibility.CompatibilityView@23f31375 |
| main | 2017-10-20 13:09:47.775 | org.eclipse.e4.ui.workbench | /debug | org.eclipse.e4.ui.internal.workbench.WorkbenchLogger | trace | 158 | Ignored attempt to set focus during set focus for: org.eclipse.ui.internal.e4.compatibility.CompatibilityView@d7b38cf |
| main | 2017-10-20 13:09:49.555 | org.eclipse.e4.ui.workbench | /debug | org.eclipse.e4.ui.internal.workbench.WorkbenchLogger | trace | 158 | Ignored attempt to set focus during set focus for: org.eclipse.ui.internal.e4.compatibility.CompatibilityView@d7b38cf |
回答by mico
I found a solution when I selected Import -> Existing Projects into Workspace
and selected the folders of previously broken worskpace to the new one. I got a semi-ready workspace which contained all settings I had previously, but it removed the error.
当我选择Import -> Existing Projects into Workspace
并选择以前损坏的工作空间的文件夹到新的文件夹时,我找到了一个解决方案。我有一个半就绪的工作区,其中包含我以前的所有设置,但它消除了错误。
The only thing I needed to change was to give my svn repo credentials again upon next commit.
我唯一需要更改的是在下次提交时再次提供我的 svn repo 凭据。
I made this after @tao's solution, when it did not solve the issue for me.
我在@tao 的解决方案之后做了这个,当时它没有为我解决问题。