org.eclipse.swt.*; The import org.eclipse cannot be resolved(org.eclipse.swt.*;导入org.eclipse无法解决)
问题描述
我正在尝试编写一个需要导入语句import org.eclipse.swt.*;
的小程序.(我正在练习 THIS 教程).
但是,Eclipse 不会编译该程序并给我错误无法解析导入 org.eclipse
"
Google 这次在寻找答案方面可不是那么好.
这是因为您尚未将 SWT 库添加到构建路径中.按照教程的步骤操作:
<块引用>- 下载 SWT 库.对于 3.1.2 版本的 eclipse,SWT 库位于http://archive.eclipse.org/eclipse/downloads/drops/R-3.1.2-200601181600/index.php查找标题为 SWT 二进制和源代码的部分.
- 从主菜单工具栏中,选择文件",然后选择导入".这样做会弹出导入向导"对话框.
- 现在选择Existing Projects into Workspace"并点击Next"按钮.
- 点击选择存档文件",然后点击浏览"按钮.现在找到您在第 1 步中下载的 SWT 存档.
- 单击完成"按钮完成将 SWT 项目导入您的工作区.
- 从文件 > 新建 Java 项目创建新的 Java 项目.
- 右键单击项目并选择属性"命令以打开属性"对话框.
- 选择 Java 构建路径,然后选择项目"选项卡,然后单击添加"按钮.
- 选择 org.eclipse.swt 项目并单击确定"完成将 SWT 库添加到项目的类路径中
I am trying to write a small program that requires the import statement import org.eclipse.swt.*;
. (I'm practicing with THIS tutorial).
However, Eclipse won't compile the program and is giving me the error "The import org.eclipse cannot be resolved
"
Google hasn't been such a a great friend at finding the answer this time.
This is because you haven't added the SWT library to your buildpath. Follow the steps of the tutorial:
- Download SWT library. For 3.1.2 version of eclipse, SWT library is available at http://archive.eclipse.org/eclipse/downloads/drops/R-3.1.2-200601181600/index.php Look for the section titled SWT Binary and Source.
- From main menu tool bar, select "File" followed by "Import". Doing so will bring up the "Import wizard" dialog.
- Now select "Existing Projects into Workspace" and click on "Next" button.
- Click on "Select archive file" followed by "Browse" button. Now locate the SWT archive that you downloaded in step 1.
- Click the Finish button to finish importing the SWT project into your workspace.
- Create new java project from File > New Java Project.
- Right-click on the project and select the Properties command to open the Properties dialog.
- Select the Java Build Path followed by Projects tab and click the Add button.
- Select the org.eclipse.swt project and click OK to finish adding the SWT libraries to your project's classpath
这篇关于org.eclipse.swt.*;导入org.eclipse无法解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:org.eclipse.swt.*;导入org.eclipse无法解决
基础教程推荐
- 降序排序:Java Map 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01