Include jar files in gradle project [duplicate]

守給你的承諾、 提交于 2019-12-11 09:03:10

问题


I am trying to include a local jar file in my "Java" gradle project. I have added jar files in my "main/resource" folder of project. and in build.gradle added following lines :-

compile files('./src/main/resources/abc.jar')

It is not showing me any error at compile time. But when i run my project it is showing me following error:-

"Caused by: java.lang.NoClassDefFoundError: javax/json/Json"


回答1:


you need to add its dependency in gradle file.

compile fileTree(dir: 'libs', include: ['*.jar'])



来源:https://stackoverflow.com/questions/49379578/include-jar-files-in-gradle-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!