Search code examples
javaintellij-ideadevelopment-environmentlibraries

Where should I store third-party libraries for inclusion in IntelliJ IDEA projects?


This is not about how to add libraries to my project or module dependencies; it's about where to store the .jar files that are referenced by the project/module settings.

Should I have a lib folder in each project, containing the third-party libraries; or should I store them elsewhere on my hard drive? What scheme has worked for you?


Solution

  • I would recommend you take a look at Maven, its a build tool which among other things manages your dependencies for you, and has tight integration with various IDE's including IntelliJ. You have a local repository on your PC into which Maven downloads copies of libraries/source/javadoc from a central repository. There is a getting started tutorial here.

    The reason I'm recommending this is that you don't need to worry where things are stored, and everything is loaded into your IDE automatically, but the actual storage is efficient because you only ever have one copy of a particular library on disk.