• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse Add to build path option

 
Greenhorn
Posts: 21
Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 79178
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
got it. Thanks!
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic