John Jerrby
John Jerrby

Reputation: 1703

import javax.persistence.EntityManager error

I have copied my project from pc to other and i got error

  1. import javax.persistence.EntityManager; importjavax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.Query;

the compiler doesn't know them, in the lib folder i added 3 jar from the local pc derby.jar eclipselink.jar and also javax.persistence_2.0.4.v201112161009.jar

what could be the reason

Upvotes: 1

Views: 8470

Answers (3)

spiritwalker
spiritwalker

Reputation: 2257

All you need is to add those jar on classpath. If you are running the project in eclipse, simply select project properties=>build path=>add jar

Upvotes: 0

duffy356
duffy356

Reputation: 3718

at first refresh your project, if you copied with OS.

then maybo you have to add them to your build path.

1 right click on your project -> build path -> configure build path -> libraries -> add JARs...

2 select project/lib folder and choose the jars to add them.

3 click OK

Upvotes: 0

Naveen Kumar Alone
Naveen Kumar Alone

Reputation: 7668

add two more Jar's that are

toplink-essentials.jar
toplink-essentials-agent.jar

Add this external jars to your project

Upvotes: 1

Related Questions