gpt4 book ai didi

eclipse - org.eclipse.swt。*;导入org.eclipse无法解析

转载 作者:行者123 更新时间:2023-12-03 13:21:36 25 4
gpt4 key购买 nike

我正在尝试编写一个需要导入语句import org.eclipse.swt.*;的小程序。 (我正在使用THIS教程进行练习)。

但是,Eclipse无法编译程序,并且给我错误“The import org.eclipse cannot be resolved

这次Google并不是很好的 friend 。

最佳答案

这是因为您尚未将SWT库添加到构建路径。请遵循本教程的步骤:

  1. 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.
  2. From main menu tool bar, select "File" followed by "Import". Doing so will bring up the "Import wizard" dialog.
  3. Now select "Existing Projects into Workspace" and click on "Next" button.
  4. Click on "Select archive file" followed by "Browse" button. Now locate the SWT archive that you downloaded in step 1.
  5. Click the Finish button to finish importing the SWT project into your workspace.
  6. Create new java project from File > New Java Project.
  7. Right-click on the project and select the Properties command to open the Properties dialog.
  8. Select the Java Build Path followed by Projects tab and click the Add button.
  9. Select the org.eclipse.swt project and click OK to finish adding the SWT libraries to your project's classpath

关于eclipse - org.eclipse.swt。*;导入org.eclipse无法解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16442294/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com