0

I have found quite some related questions, but not one that could solve my problem. I have some Java source code in my eclipse project, I get a
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/hibernate/HibernateException : Unsupported major.minor version 52.0 When running my class, even though its a Hibernate exception, the inner exception comes from the ClassLoader after invoking a default constructor. It is clear to me that apparently I am running in JRE7 a class compiled with java8 compiler, however, I can't see that in my project configuration, here's the compiler (1.7): Compiler:

And here's the JRE: enter image description here

Also from window > preference > Java > compiler, I see that is compiled in java 7 enter image description here

After cleaning the project several times, so to make sure no old classes are there, and resolving dependencies in maven, I still get this. Any advice will be highly appreciated.

abhink
  • 8,740
  • 1
  • 36
  • 48
JBoy
  • 5,398
  • 13
  • 61
  • 101
  • @soorapadman Not a possible duplicate, related, but not the same, the other one is running from command line compiling source code from a notepad file – JBoy Aug 23 '16 at 09:28
  • to resolve your issue could you use same java version ? – soorapadman Aug 23 '16 at 09:30
  • check this link:http://stackoverflow.com/questions/24790834/cant-fix-unsupported-major-minor-version-52-0-even-after-fixing-compatibility – soorapadman Aug 23 '16 at 09:31

2 Answers2

0

Probably the class compiled with java 8 is not in your code, but in a library imported in your code.

Check the version of each library imported in your project to see if one of them needs java 8 as a requirement.

Davide Lorenzo MARINO
  • 26,420
  • 4
  • 39
  • 56
0

Probably in your classpath there are some libs compiled with JDK8.

mauretto
  • 3,183
  • 3
  • 27
  • 28
  • 1
    someone had updated pom.xml on remote repo to download hibernate core 5.2.2 which needs java 8, grazie mauretto – JBoy Aug 23 '16 at 09:45