Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project
build, dependency-management, intellij-idea, java
Solution
Steps for adding external jars in IntelliJ IDEA:
- Click File from the toolbar
- Select Project Structure option (CTRL + SHIFT + ALT + S on Windows/Linux, ⌘ + ; on Mac OS X)
- Select Modules at the left panel
- Select Dependencies tab
- Select + icon
- Select 1 JARs or directories option
Problem
When creating a new Java project in IntelliJ IDEA, the following directories and files are created: ``` ./projectname.iml ./projectname.ipr ./projectname.iws ./src/ ``` I want to configure IntelliJ IDEA to include my dependency JARs in `./lib/*.jar` to the project. What is the correct way to achieve this in IntelliJ IDEA?