Where do you put the .jar file for an external library in java

user3002473 picture user3002473 · Dec 28, 2014 · Viewed 7.7k times · Source

This is probably a pretty stupid question. I just learned how to use external libraries in java by adding the .jar file to the classpath and whatnot, but where exactly do you keep the .jar file? In a video tutorial about adding .jar files to the classpath, the programmer just kept the .jar file in his downloads folder. So can you put the file anywhere? Or is there a general paradigm as to where you keep your library files that I should abide by?

Answer

atish shimpi picture atish shimpi · Dec 28, 2014

It is better to use Dependency Management Systems like maven but if you have restriction for that then,

It's always better to put your jar file inside in your project lib folder because in migration time it will help you to keep all thing at one place.

In case of multiple project it will be better to have one centralize location on server where you put your jar files.