3

On running my main program I am getting the above error. I am not sure what could be the reason for this.

On one of the pages online I found that the class files have been generated by a different version of the compiler and the current JDK is different

I deleted everything inside the .m2 folder and the target folder, but still, it showed the same error. Not sure maybe I should delete the .idea folder too and check.

There should be some way to resolve it without changing to Java 11.

This is the exact error -

java: cannot access org.hibernate.Session
bad class file: /C:/Users/name/.m2/repository/org/hibernate/orm/hibernate-core/6.0.0.CR1/hibernate-core-6.0.0.CR1.jar!/org/hibernate/Session.class
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
2
  • Canyou show your pom.xml?
    – dan1st
    Feb 22, 2022 at 10:15
  • @sp00m Changing to JDK 11 resolved the issue. You can post this as an answer and I will mark it as a solution
    – dnaiel
    Feb 23, 2022 at 4:03

1 Answer 1

2

Hibernate 6.0 and later versions require at least Java 11 (https://docs.jboss.org/hibernate/orm/6.0/userguide/html_single/Hibernate_User_Guide.html#_system_requirements).

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.