I've been learning java web for several weeks and I always use "/web/WEB-INF/lib" as my compile classpath. Well, I don't feel right doing this, because I think that's not how "/web" directory supposed to be used. Recently, I see an example on the Internet that uses "/lib" (directly under root) as its compile classpath. However, if I do put my library (e.g. JDBC driver) under "/lib", still I have to put that library under "/web/WEB-INF/lib" for runtime usage, so the file will be redundant.
So basically my question is, where should I put external libraries?
andree surya wrote:... So basically my question is, where should I put external libraries?
I'm not sure your are talking about building with IDE or in general. But people use different approaches in this, specially building with Ant etc.. In this case If you have put the "jars" inside the WEB-INF/lib then you can point them to the compiler too, so you don't have to have duplicates. If you are talking about any IDE like "Eclipse" then you may have some common "user libraries" setup to use in each project (which can be used config the build path).
Currently I'm working without IDE, and I configure the classpath manually inside the ant build file.
I set my compile classpath by including every jar files inside /web/WEB-INF/lib. So it's okay and common to do this? I don't need to create a separate /lib directory?