This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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 ..
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.
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.
An IDE is no substitute for an Intelligent Developer.