35

我一直在使用 Eclipse Juno 非常好,直到最近我启动它时收到以下错误:

发生了错误。查看日志文件 C:\Users\Quinn\workspace.metadata.log

我对编程比较陌生,因此非常感谢外行的任何帮助。谢谢!

.log 文件非常长,所以我只添加最后一部分。如果您需要更多信息。请不要害怕问。谢谢!

!SESSION 2012-08-04 12:08:30.616 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.6.0_33
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.core.resources 2 10035 2012-08-04 12:08:32.307
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.equinox.preferences 4 2 2012-08-04 12:08:34.434
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.preferences".
!STACK 0
java.lang.ExceptionInInitializerError
    at org.eclipse.wb.internal.core.preferences.PreferenceInitializer.initializeDefaultPreferences(PreferenceInitializer.java:50)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:300)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:303)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:131)
    at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
    at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
    at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
    at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:410)
    at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:663)
    at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:805)
    at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
    at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:76)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:250)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(ScopedPreferenceStore.java:285)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.internalGet(ScopedPreferenceStore.java:475)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getBoolean(ScopedPreferenceStore.java:387)
    at org.eclipse.wb.internal.core.editor.describer.JavaSourceUiDescriber.isGUISource(JavaSourceUiDescriber.java:65)
    at org.eclipse.wb.internal.core.editor.describer.JavaSourceUiDescriber.describe(JavaSourceUiDescriber.java:52)
    at org.eclipse.core.internal.content.ContentTypeCatalog.describe(ContentTypeCatalog.java:218)
    at org.eclipse.core.internal.content.ContentTypeCatalog.collectMatchingByContents(ContentTypeCatalog.java:190)
    at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:403)
    at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:450)
    at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:346)
    at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:360)
    at org.eclipse.core.internal.content.ContentTypeMatcher.getDescriptionFor(ContentTypeMatcher.java:86)
    at org.eclipse.core.internal.resources.ContentDescriptionManager.readDescription(ContentDescriptionManager.java:445)
    at org.eclipse.core.internal.resources.ContentDescriptionManager.getDescriptionFor(ContentDescriptionManager.java:355)
    at org.eclipse.core.internal.resources.File.internalGetCharset(File.java:246)
    at org.eclipse.core.internal.resources.File.getCharset(File.java:207)
    at org.eclipse.core.internal.resources.File.getCharset(File.java:194)
    at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1156)
    at org.eclipse.jdt.internal.core.builder.SourceFile.getContents(SourceFile.java:79)
    at org.eclipse.jdt.internal.compiler.ReadManager.run(ReadManager.java:173)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:4361)
    at org.eclipse.swt.SWT.error(SWT.java:4276)
    at org.eclipse.swt.SWT.error(SWT.java:4247)
    at org.eclipse.swt.widgets.Display.error(Display.java:1258)
    at org.eclipse.swt.widgets.Display.checkDevice(Display.java:764)
    at org.eclipse.swt.widgets.Display.getSystemFont(Display.java:2459)
    at org.eclipse.jface.preference.PreferenceConverter.<clinit>(PreferenceConverter.java:84)
    ... 35 more

!ENTRY org.eclipse.osgi 4 0 2012-08-04 12:08:35.102
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jface.preference.PreferenceConverter
    at org.eclipse.ui.internal.themes.ThemeElementHelper.installFont(ThemeElementHelper.java:103)
    at org.eclipse.ui.internal.themes.ThemeElementHelper.populateRegistry(ThemeElementHelper.java:59)
    at org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1550)
    at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2478)
    at org.eclipse.ui.internal.Workbench.access$7(Workbench.java:2386)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:583)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    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:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    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:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY com.android.ide.eclipse.adt 4 0 2012-08-04 12:08:36.083
!MESSAGE parseSdkContent failed
!STACK 0
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.AdtPlugin.getDisplay(AdtPlugin.java:334)
    at com.android.ide.eclipse.adt.AdtPlugin$7.run(AdtPlugin.java:1422)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!SESSION 2012-08-04 12:25:48.967 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.6.0_33
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.core.resources 2 10035 2012-08-04 12:25:50.607
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.equinox.preferences 4 2 2012-08-04 12:25:52.846
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.preferences".
!STACK 0
java.lang.ExceptionInInitializerError
    at org.eclipse.wb.internal.core.preferences.PreferenceInitializer.initializeDefaultPreferences(PreferenceInitializer.java:50)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:300)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:303)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:131)
    at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
    at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
    at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
    at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:410)
    at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:663)
    at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:805)
    at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
    at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:76)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:250)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(ScopedPreferenceStore.java:285)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.internalGet(ScopedPreferenceStore.java:475)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getBoolean(ScopedPreferenceStore.java:387)
    at org.eclipse.wb.internal.core.editor.describer.JavaSourceUiDescriber.isGUISource(JavaSourceUiDescriber.java:65)
    at org.eclipse.wb.internal.core.editor.describer.JavaSourceUiDescriber.describe(JavaSourceUiDescriber.java:52)
    at org.eclipse.core.internal.content.ContentTypeCatalog.describe(ContentTypeCatalog.java:218)
    at org.eclipse.core.internal.content.ContentTypeCatalog.collectMatchingByContents(ContentTypeCatalog.java:190)
    at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:403)
    at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:450)
    at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:346)
    at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:360)
    at org.eclipse.core.internal.content.ContentTypeMatcher.getDescriptionFor(ContentTypeMatcher.java:86)
    at org.eclipse.core.internal.resources.ContentDescriptionManager.readDescription(ContentDescriptionManager.java:445)
    at org.eclipse.core.internal.resources.ContentDescriptionManager.getDescriptionFor(ContentDescriptionManager.java:355)
    at org.eclipse.core.internal.resources.File.internalGetCharset(File.java:246)
    at org.eclipse.core.internal.resources.File.getCharset(File.java:207)
    at org.eclipse.core.internal.resources.File.getCharset(File.java:194)
    at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1156)
    at org.eclipse.jdt.internal.core.builder.SourceFile.getContents(SourceFile.java:79)
    at org.eclipse.jdt.internal.compiler.ReadManager.run(ReadManager.java:173)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:4361)
    at org.eclipse.swt.SWT.error(SWT.java:4276)
    at org.eclipse.swt.SWT.error(SWT.java:4247)
    at org.eclipse.swt.widgets.Display.error(Display.java:1258)
    at org.eclipse.swt.widgets.Display.checkDevice(Display.java:764)
    at org.eclipse.swt.widgets.Display.getSystemFont(Display.java:2459)
    at org.eclipse.jface.preference.PreferenceConverter.<clinit>(PreferenceConverter.java:84)
    ... 35 more

!ENTRY org.eclipse.osgi 4 0 2012-08-04 12:25:53.650
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jface.preference.PreferenceConverter
    at org.eclipse.ui.internal.themes.ThemeElementHelper.installFont(ThemeElementHelper.java:103)
    at org.eclipse.ui.internal.themes.ThemeElementHelper.populateRegistry(ThemeElementHelper.java:59)
    at org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1550)
    at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2478)
    at org.eclipse.ui.internal.Workbench.access$7(Workbench.java:2386)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:583)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    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:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    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:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY com.android.ide.eclipse.adt 4 0 2012-08-04 12:25:54.453
!MESSAGE parseSdkContent failed
!STACK 0
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.AdtPlugin.getDisplay(AdtPlugin.java:334)
    at com.android.ide.eclipse.adt.AdtPlugin$7.run(AdtPlugin.java:1422)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
4

11 回答 11

76

我在用于 Android 开发的 Eclipse Juno 上遇到了同样的问题。

作为 Windows 的解决方法,我从控制台启动它,如下所示:

C:\path\to\eclipse\eclipse -clean

正如这里所暗示的,您还可以尝试删除文件 YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.snap

这也对我有用,并且(到目前为止)似乎永久解决了这个问题,这与第一个选项不同。

于 2012-08-07T12:58:10.897 回答
32

我通过删除重新开始我的工作区

org.eclipse.e4.workbench

从 .plugins 文件夹中。然后从-clean国旗开始。

于 2012-11-26T11:49:33.583 回答
5

在 Mac 中,您需要删除工作区的此文件

.metadata/.plugins/org.eclipse.core.resources/.snap 
于 2013-12-03T22:39:51.607 回答
4

删除/[PATH TO WORKSPACE]/.metadata/.plugins/org.eclipse.core.resources 它将让 eclipse 恢复工作

于 2013-02-14T02:57:12.330 回答
2

转到您的 Eclipse 工作区并在给定路径中找到 .snap 文件

.metadata/.plugins/org.eclipse.core.resources/.snap 

删除快照文件应该有魔力,什么是.snap文件好AFAIK

.snap 文件包含运行时 IDE 工作区状态的所有变化,用于 Eclipse 崩溃恢复计划。

于 2014-07-17T12:05:16.810 回答
2

将插件文件夹 org.eclipse.core.resources [可能到桌面] 剪掉,然后启动 eclipse。现在,您将看到没有项目的 Eclipse 打开。现在关闭 Eclipse 并再次将插件文件夹复制回来并启动 Eclipse。现在你应该看到你所有的 Eclipse 项目都打开了。

于 2013-11-19T21:38:08.503 回答
1

在 Windows 8 上出现同样的错误。以管理员身份运行 eclipse 解决了这个问题。

于 2014-08-14T10:29:05.083 回答
1

我已删除元数据文件夹并重新启动 eclipse 并从同一工作区文件夹导入所有项目。问题解决了。

于 2014-03-05T05:53:43.470 回答
0

只需删除 Workspace.metadata.plugins 中的 org.eclipse.core.resources 文件夹即可。但是您必须再次将所有项目导入到 eclipse 中,因此我们删除了 eclipse 的资源处理文件夹。希望这可以帮助

于 2012-12-16T04:27:38.113 回答
0

删除:/YOUR PATH TO WORKSPACE/.metadata/.plugins/org.eclipse.core.resources

这对我有用

于 2016-02-23T10:28:47.660 回答
0

简单地删除工作空间中的 .metadata 文件,然后使用相同的路径再次创建工作空间。它对我有用。

于 2015-11-24T04:41:31.327 回答