• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse Add to build path option

 
Haritha Gorijavolu
Greenhorn
Posts: 21
Debian Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50171
79
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20659
64
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Haritha Gorijavolu
Greenhorn
Posts: 21
Debian Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it. Thanks!
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic