Eclipse:应用程序无法启动

时间:2014-09-13 09:55:28

标签: java eclipse

我正在研究eclipse上的java项目。当我按Run As Eclipse Application时,它曾经工作。现在它突然停止了工作:

LaunchError

自上次工作以来我唯一做的就是卸载和安装不同的java和jdk版本。目前我在C:\Program Files\Java中有这3个:

  • jre7
  • jre1.8.0_20
  • jdk1.8.0_20

我不知道第二个是什么。我在"Programs and Features"找不到它。

path变量中我有:

C:\Program Files\Java\jre7\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\libnvvp;C:\Python27\Lib\site-packages\PyQt4;C:\Python27;C:\Python27\Scripts;C:\OpenSSH\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Downloads\Android\adt-bundle-windows-x86_64-20140702\sdk\tools

当我在错误消息上点击"Yes, in an editor"时,这是一些日志:

!SESSION 2014-08-25 17:21:53.071 -----------------------------------------------
eclipse.buildId=M20090917-0800
java.version=1.7.0_67
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data C:\Dropbox\University\Semester 5\Project\workspace/../runtime-EclipseApplication -dev file:C:/Dropbox/University/Semester 5/Project/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86_64

This is a continuation of log file C:\Dropbox\University\Semester 5\Project\runtime-EclipseApplication\.metadata\.bak_0.log
Created Time: 2014-08-25 17:21:56.118

!ENTRY org.eclipse.osgi 4 0 2014-08-25 17:21:56.118
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:114)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
    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:368)
...
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.core.resources (3814).
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:381)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:454)
...
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:806)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
...
Caused by: java.lang.StackOverflowError
    at java.util.HashMap.init(Unknown Source)
    at java.util.HashMap.<init>(Unknown Source)
    at java.util.HashMap.<init>(Unknown Source)
    at java.util.HashSet.<init>(Unknown Source)
    at org.eclipse.core.internal.resources.MarkerTypeDefinitionCache.computeSuperTypes(MarkerTypeDefinitionCache.java:88)
    at org.eclipse.core.internal.resources.MarkerTypeDefinitionCache.computeSuperTypes(MarkerTypeDefinitionCache.java:94)
...
!ENTRY org.eclipse.jdt.core 2 0 2014-08-28 10:19:14.693
!MESSAGE The Java indexing could not index C:/Program Files/Java/jre7/lib/ext/nashorn.jar|jdk/nashorn/internal/objects/NativeArray$Constructor.class. This .class file doesn't follow the class file format specification. Please report this issue against the .class file vendor
...

为什么会这样?

我应该发布其他信息以便确定问题吗?

修改

我在项目中发现了以下警告:

The JRE container on the classpath is not a perfect match to the 'JavaSE-1.6' execution environment MANIFEST.MF /JDTCommentsV2/META-INF line 11 Plug-in Problem

对应MANIFEST.MF中的这一行:

Bundle-RequiredExecutionEnvironment: JavaSE-1.6

修改

我修正了:右击 - &gt;快速修复

但现在又出现了另一个错误:

Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment.

解决方案herehere建议在项目中选择Workspace default JRE - &gt;属性 - &gt;添加库 - &gt; JRE系统库。这带回了:

The JRE container on the classpath is not a perfect match to the 'JavaSE-1.6' execution environment MANIFEST.MF /JDTCommentsV2/META-INF line 11 Plug-in Problem

修改

我更改了workspace位置(将其放在桌面上),现在可以正常工作了。但我需要原始路径(因为它是Dropbox中的共享文件夹...)。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

Bundle-RequiredExecutionEnviornment属性指示需要Java 1.6。 OSGi文档暗示,具有此属性的bundle不一定支持更高版本的Java,但我没有特别发现。错误消息指向需要Java 1.6环境来运行此捆绑包(jar文件,无论如何),并且您的路径没有一个,只有一个晚于1.6的路径。我会安装1.6,消除其他的,确保classpath和eclipse选择的JRE / JDK指向1.6,刷新eclipse中的所有项目,然后重启你的机器。

相关问题