I was getting an error that javax.persistence.* was not found in all of my classes in Eclipse, so I dragged and dropped the jpa.jar file into the the project folder where all the other jars are....seemed to fix the problem - resolved all errors, BUT when I close and relaunch Eclipse the errors are back, BUT the jpa.jar file is still there....Any ideas why relaunching Eclipse is causing the jpa.jar to not be recognized?
Hi Sagar....I am not...I tried two different ways: 1.) File -> Import -> Archived JAR and 2.) Dragging and dropping it in the project directory containing all jars....I think what your saying is the buildpath is not getting updated?....I will try the way you suggest....Thanks!
posted 8 years ago
Hi Sagar -
That worked beautifully...Thank You!...Let me ask what is the difference between your method and doing a File -> Import -> JAR.....?
Mirrell Knabe wrote:Let me ask what is the difference between your method and doing a File -> Import -> JAR.....?
Honestly, I don't know. I do import whenever I want to import an Eclipse project into my workspace, thats all I do using Import and when you add jar/libraries into a Java Build Path, Eclipse add the CLASSAPTH setting for that JAR in your project for you. Check the CLASSPATH file in your project directory for the same.
Using "File Import->Archive File" will extract the content of the archived file, which means that it will copy the files from the JAR, into your project. you should never do that. JAR files should be added in the classpath, the way Sagar explained.