tags:

views:

33

answers:

1

Hello,

When i develop a project i create a folder in my project called libs. And in this folder i place all the library jars that i use. Is there a way to add just the libs folder to the class path so that i do not have to add each individual jar?

I was thinking something along the lines of a variable or creating a user library.

Many thanks.

+1  A: 

Based on what you've said, I would probably create a user library containing your library JARs.

You can create a User Library with Window, Preferences, drill down to Java, Build Path, User Libraries. Then choose New, and give your library a name. Then add the JARs you want.

Then you can add all the JARs to the classpath of any project you have by right-clicking on the project, Add Libraries, User Libraries, and selecting your library.


Update; to have Eclipse dynamically add .jar files you drop into a folder to your project classpath, you need a plugin called Library Folder ClasspathContainer. Follow these instructions and you're in business.

Brabster
I hear your idea/solution but its not what i am looking for. Basically for every new project i create i just want eclipse to pick up the libs folder in that project and automatically add the jars i place into it. Exactly like the WEB-INF/lib folder on a web project.
Paul
I see what you're looking for now. Looks like Eclipse can't do that out of the box, but there's a plugin here (http://sourceforge.net/projects/libcontainer/) that will automatically add .jars in a folder to your classpath. Hopefully that'll do the job. Trying it now...
Brabster
Works a treat. Nice question - I'll use this myself!
Brabster