问题描述
我正在考虑如何将SWT UI库导入到我的Java项目中。
我在maven上找到了SWT的pom文件:
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
从文件中我将以下行添加到我的 build.gradle
文件
From the file I added the following line to my build.gradle
file
compile "org.eclipse:swt:3.3.0"
但是,当我将其添加到我的 build.gradle
时,我收到以下错误:
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.
我的IDE是Eclipse。
My IDE is Eclipse.
推荐答案
你必须在依赖行中使用整个包名,包括版本号。
You have to use the whole package name in the dependency line, including the version number.
因此,添加:编译org.eclipse:swt:3.3.0-v3346
到 build.gradle
文件。
这篇关于导入SWT作为Gradle依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!