Search code examples
javaclassloaderunsupported-class-version

Unsupported java class version 52


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.


Solution

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