Java – What jar should I include to use javax.persistence package in a hibernate based application

hibernatejarjava

Is it ok to take it from Glassfish project ( glassfish-persistence-api) or may be there is a Hibernate jar?

Best Solution

If you are using maven, adding below dependency should work

<dependency>
    <groupId>javax.persistence</groupId>
    <artifactId>persistence-api</artifactId>
    <version>1.0</version>
</dependency>