This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 37902
    
  22
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: 19649
    
  18

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: 5811
    
    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
Eclipse and importing JARS
why Java build path in Eclipse when the Jar files are available in Lib folder
Java 5 EE to MySQL
Facing problem while compiling Action Class
The absolute uri: http://java.sun.com/jstl/core cannot be resolve