Eclipse打不开,提示“An error has occurred.See the log file ***/.log”

阅读更多
打开eclipse工作目录的\.metadata\.log文件,发现如下错误:

!ENTRY org.eclipse.osgi 4 0 2012-09-10 09:28:57.139
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.core.resources (70).
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:462)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 13 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    ... 22 more
Caused by: org.eclipse.core.internal.resources.ResourceException: Could not read master table.
    at org.eclipse.core.internal.resources.SaveManager.restoreMasterTable(SaveManager.java:835)
    at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:684)
    at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1527)
    at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2503)
    at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2251)
    at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:439)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
    ... 28 more
Caused by: java.io.FileNotFoundException: D:\workspace\.metadata\.plugins\org.eclipse.core.resources\.safetable\org.eclipse.core.resources (鎷掔粷璁块棶銆?
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.(Unknown Source)
    at org.eclipse.core.internal.localstore.SafeChunkyInputStream.(SafeChunkyInputStream.java:35)
    at org.eclipse.core.internal.localstore.SafeChunkyInputStream.(SafeChunkyInputStream.java:31)
    at org.eclipse.core.internal.resources.SaveManager.restoreMasterTable(SaveManager.java:827)
    ... 36 more

解决方法:
可能是丢失部分起动文件导致的。删除指定的工作目录下.metadata/.plugins的文件夹下所有文件,然后重起Eclipse!
 
还有一种情况,用着好好的,突然打不开.xml文件,打开时就卡死了,或者使用时设个断点之类的也卡死了,甚至点击一下打开的文件,也卡死了。
解决方法:
将工作目录里的那个.metadata删掉,重启Eclipse,导入工程。

你可能感兴趣的:(eclipse)