In this article, we are discussing the hibernate java.lang.ClassNotFoundException: javax.persistence.Entity, When you work on jpa project then this exception will occur very frequently,
In JPA project, compiler is not able to find javax.persistence.Entity class as it is not included by default. It is stored in some jar which you have to include in your project to resolve this exception. Refer the solution below on how and what jar to add in your project to solve this issue.
javax.persistence.Entity class is present inside the J2EE SDK library "javaee.jar". You are missing this jar file in your project classpath.
You can add javaee.jar in your project by two ways:
You can get the javaee.jar from Download javaee.jar
Download the javaee.jar file from above link and include it in your classpath.