2

I have been trying to fix this problem for several hours now, and I am totally at my wits end.

My old computer crashed, but luckily I was able to recover most of my files. I installed eclipse on my desktop, and attempted to import a few projects into eclipse. Every one of them had problems, and not a single one will run. I am running Windows 7 on a homebuild PC- I am 99% sure this is not a hardware problem, I don't think you need specs.

First, every time I import I have followed this thread because it is the first of my problems: every time I import a project, eclipse will not recognize anything from java and I apparently need to manually tell it what to use (which is annoying, and if anyone has a fix for this it would be great to know how to stop it).

But the big problem comes after I fix that. Whenever I try to run the project, no matter which project it is I get the error I copied in the description:

Exception in thread "main" java.lang.UnsupportedClassVersionError: MainMethod : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

I have tried just about everything, and am getting pretty close to just breaking the whole thing. I have followed all of the following guides: this one, this one and this one. All of them say to do the same thing: change the project preferences and check the compiler settings. The settings should match.

I am running JDK7 and JRE7. JRE8/JDK8 is not installed anywhere on my desktop- I am not sure why eclipse seems to think it is. My question is this: how do I fix this problem? Do I need to do a clean install and follow a specific set of steps to stop this from happening? Do I need to put JDK8 on my computer? Do I need ro re-import the projects into the workspace in a specific way? Am I just stuck?

Community
  • 1
  • 1

2 Answers2

0

If you have followed the steps of configuring JDK, the project might be referring to previously generated classes. You may try Project on menu > Clean, select all projects and then try to run the application.

Moreover, go to Project Properties, Java Build Path, Libraries and confirm that you are referring to the correct Java Runtime version.

James Jithin
  • 10,183
  • 5
  • 36
  • 51
0

Your project was created with a version of Java JDK, but your eclipse has a older version of JDK.

Verify if the version of your project's JDK is the same of the eclipse's JDK.

Raduan Santos
  • 1,023
  • 1
  • 21
  • 45