Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project

后端 未结 9 1496
时光取名叫无心
时光取名叫无心 2020-11-21 10:20

When creating a new Java project in IntelliJ IDEA, the following directories and files are created:

./projectname.iml
./projectname.ipr
./projectname.iws
./s         


        
9条回答
  •  长发绾君心
    2020-11-21 10:39

    I use this method and it works well:

    1- Copy And paste the .jar files under the libs folder.

    2- Add compile fileTree(dir: 'libs', include: '*.jar') to dependencies in build.gradle then all the jars in the libs folder will be included..

    3- Right click on libs folder and select 'Add as library' option from the list.

提交回复
热议问题