This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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!
Joined: Oct 13, 2008
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.