• 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

adding external jars to a project in eclipse

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently using eclipse for my java project development. I wanted to know if there was a way to add external jars to all the java projects (including any new ones i might create in the future) directly in eclipse. I am aware of going through the project properties -> buildpath->add external jars for individual projects but is there a way i can do it for all the projects. I was hoping to find it under window -> preferences ->build path but was unable to find anything. Anyone knows if its possible?

edit: i guess i should have posted this question in the IDE section but i couldnt delete the topic so sorry about that ..
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't think it is possible for every project in one stage. Remember it is likely that different projects will require different resources.

I shall move this thread to where we usually discuss IDEs.
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..,

Another way of doing this is to create a dummy project whih will hold all your jars, and you just add this dummy project in the classpath of your project.
But remember that eclipse [from 3.0] makes use of the OSGi container concepts.... hence until and unless you specify the jar, and its version usually
explicitly, it will not pick up the jar from its location. That is a standard feature of OSGi.

cheers,
Dawn
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I sometimes have a "lib" project that contains external jars. I don't have as many of them as I used to, however, since I use Maven a lot now.

There are some cases, however, where I find it better to go all the way back to the source. For example, I need the J2EE api jars from tomcat. For that, I define an external library. The Java/Build Path/User Libraries preferences allows me to create a TOMCAT user library and indicate the jars I want, giving their original locations in TOMCAT_HOME/lib. I can then reference that library in individual projects.

There are 2 benefits to that.

1. If I install a new version of Tomcat, I can change the user library and all projects will automatically pick up on it.

2. The ".classfile" will use the symbolic definition instead of absolute filesystem location. So it I check a project into CVS or Subversion and someone else checks it out, they can set up their own definition of the tomcat user library using whatever directory setup their particular machine happens to have.
 
reply
    Bookmark Topic Watch Topic
  • New Topic