0

I'm working on a java project on eclipse. It used to work when i press Run As Eclipse Application. And now it suddenly stopped working:

LaunchError

The only thing i did since the last time it worked is uninstalling and installing different java and jdk versions. Currently i have these 3 in C:\Program Files\Java:

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

I don't know what's the 2nd one. I can't find it in "Programs and Features".

In the path variable i have:

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

And here's some of the log when i hit "Yes, in an editor" on the error message:

!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
...

Why is this happening?

Should i post additional information so the problem could be identified?

edit:

I found the following warning in the project:

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

corresponding to this line in MANIFEST.MF:

Bundle-RequiredExecutionEnvironment: JavaSE-1.6

edit:

I fixed that by: right-click -> Quick Fix

but now i got another error:

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

Solutions here and here suggest choosing Workspace default JRE in Project->Properties -> Add Library -> JRE System Library. This brings back the:

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

edit:

i changed the workspace location (put it on desktop) and now it works. But i need the original path (because it's a shared folder in dropbox...). Any ideas?

Community
  • 1
  • 1
Alaa M.
  • 4,961
  • 10
  • 54
  • 95
  • Not sure if this is applicable or not, but: If you go to Windows -> preferences -> Java -> Installed JRE's. Does it show a JRE you're using? You could try adding a new JRE from the location you specified. You would do this by: Add... -> Standard VM -> JDK path to JRE home -> Finish. After that select the JRE from the Installed JRE's section. – Bono Sep 13 '14 at 10:07
  • Yes i have 2 things there: jdk1.8.2_20 and jre7. Choosing `jre7` gives the described problem, and choosing `jdk1.8.2_20` gives the error: `The project was not built since its build path incomplete...` and – Alaa M. Sep 13 '14 at 10:52
  • Try some of these answers: http://stackoverflow.com/questions/9341644/the-project-was-not-built-since-its-build-path-is-incomplete – Bono Sep 13 '14 at 10:54
  • Hm, if you set it back to JRE7 (I guess that's the latest version, so it should be compatible). Also, do you have a JDK installed? – Bono Sep 13 '14 at 11:12
  • Yes i have the latest jdk installed: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html – Alaa M. Sep 13 '14 at 11:14

1 Answers1

0

The Bundle-RequiredExecutionEnviornment property indicates that Java 1.6 is required. The OSGi documentation implies that later versions of Java are not necessarily supported by a bundle with this property, though I didn't find that specifically. The error messages point to needing a Java 1.6 environment for this bundle (jar file, whatever) to run, and your path doesn't have one, only ones that are later than 1.6. I would install 1.6, eliminate the other ones, ensure that classpath and the chosen JRE/JDK for eclipse points to 1.6, refresh all projects in eclipse, and reboot your machine.

arcy
  • 12,845
  • 12
  • 58
  • 103
  • What do you mean "your path doesn't have one"? The path in the `Environment Variables`? OK then i downloaded jre6 instead of 7, and updated the `path` accordingly. Also, in project -> properties -> java build path i have [JavaSE-1.6] – Alaa M. Sep 13 '14 at 11:29
  • Ok - third edit says "I changed the workspace location (put it on desktop) and now it works. But i need the original path (because it's a shared folder in dropbox...)." Original path to what? Moving the eclipse workspace to the desktop doesn't seem like it would fix this to me, but then it's hard to debug this sort of thing remotely -- there are too many bits of barely connected information, and I know it's hard to know which bits to put in a question. – arcy Sep 13 '14 at 20:05