Search code examples
javaeclipsejarbuildpath

Why do you sometimes need to add a JAR to your build path and sometimes you don't?


I've been developing in Eclipse and every now and then I come across having to add JARs to WEB-INF\lib. My question is why sometimes I need to add them to the build path and sometimes I can just dump them in there.


Solution

  • If you need them at compile time, they need to be in the build path. If you only need them at runtime, adding them to WEB-INF\lib is sufficient.