Import SWT as a Gradle dependency

匿名 (未验证) 提交于 2019-12-03 10:24:21

问题:

I am looking at how to import the SWT UI library into my Java project. I found the pom file for SWT on maven at: https://repo1.maven.org/maven2/org/eclipse/swt/3.3.0-v3346/swt-3.3.0-v3346.pom

From the file I added the following line to my build.gradle file

compile "org.eclipse:swt:3.3.0" 

however when I added it to my build.gradle I received the following error:

Project 'L-CAD Main' is missing required library: '/home/ashley/unresolved dependency - org.eclipse swt 3.3.0' 

If I understand this right this means it can't find the dependency, so I don't know what I'm doing wrong.

My IDE is Eclipse.

回答1:

You have to use the whole package name in the dependency line, including the version number.

Therefore add: compile "org.eclipse:swt:3.3.0-v3346" to the build.gradle file.



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