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 Add to build path option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse Add to build path option" Watch "Eclipse Add to build path option" New topic
Author

Eclipse Add to build path option

Haritha Gorijavolu
Greenhorn

Joined: Feb 18, 2011
Posts: 21

I am using eclipse. I was told that, whenever I import a package for new functionality, I should to add it to lib folder and then right-click on it -> Build Path -> Add to build path.
What happens if I just import the package into my lib folder and leave it alone?
I don't understand whats going on behind the scenes. Why am I required to do that?
Thanks in advance.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36579
    
  16
Haritha Gorijavolu wrote: . . . What happens if I just import the package into my lib folder and leave it alone? . . .
don't know. Have you tried it?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

Because Eclipse doesn't treat the "lib" folder as any special folder, so it doesn't know the files in it should be added to the class path / build path. You must specify this specifically for each single JAR file you need.

Moving to our IDEs forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Haritha Gorijavolu
Greenhorn

Joined: Feb 18, 2011
Posts: 21

got it. Thanks!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

A little off the topic, but hopefully helpful: use Maven for your builds and use the m2eclipse plugin. Then the dependencies in your Maven build script (pom.xml) will be synched with the libraries that Eclipse knows about.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse Add to build path option
 
Similar Threads
Facing problem while compiling Action Class
Eclipse and importing JARS
Java 5 EE to MySQL
The absolute uri: http://java.sun.com/jstl/core cannot be resolve
why Java build path in Eclipse when the Jar files are available in Lib folder