File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse IDE and jars Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse IDE and jars" Watch "Eclipse IDE and jars" New topic
Author

Eclipse IDE and jars

Mirrell Knabe
Ranch Hand

Joined: Oct 13, 2008
Posts: 32
Hi All -

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?

Thanks.
Mirrell
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Are you adding JARs like this:
[t]Project > Properties > Java Build Path > Libraries > Add external jars[/t]
?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Mirrell Knabe
Ranch Hand

Joined: Oct 13, 2008
Posts: 32
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!
Mirrell Knabe
Ranch Hand

Joined: Oct 13, 2008
Posts: 32
Hi Sagar -

That worked beautifully...Thank You!...Let me ask what is the difference between your method and doing a File -> Import -> JAR.....?

Thanks,
Mirrell

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse IDE and jars
 
Similar Threads
Ant Query
How to start JPA
Eclipse JARing
Why NestedServletException?
Where is org. springframework. orm.jpa.vendor. TopLinkJpaVendorAdapter?