本文介绍了Eclipse Oxygen-由于构建路径不完整,因此未构建项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Eclipse Oxygen,并尝试将现有项目打开到工作台中,但出现此错误:

I just installed Eclipse Oxygen and tried to open an existing project into the workbench but I get this error:

我尝试右键单击该项目-转到属性-Java Build路径-库-添加库-JRE系统库和选定的工作台默认JRE(jre1.8.0_60)。

I tried right clicking on the project - went to Properties - Java Build Path - Libraries - Add Library - JRE System Library and selected Workbench default JRE (jre1.8.0_60).

我然后清理并重建了项目,但随后导致更多错误像这样出现:

I then cleaned and rebuilt the project but it then causes more errors to come up like:

ActionBar cannot be resolved to a type
Activity cannot be resolved to a variable
AdapterView cannot be resolved to a type
ArrayAdapter cannot be resolved to a type


推荐答案

您正在使用Maven吗?如果是这样,

Are you using Maven? If so,


  1. 右键单击项目的构建路径,然后转到配置构建路径

  2. 单击库选项卡。如果列表中没有Maven依赖项,则需要添加它。

  3. 关闭对话框。

要添加它:
右键单击该项目,Maven→禁用Maven Nature
右键单击该项目,配置→转换为Maven项目。

To add it:Right-click on the project, Maven → Disable Maven NatureRight-click on the project, Configure → Convert to Maven Project.

然后清理

编辑1:

如果不能解决问题的方法,请尝试右键单击您的项目,然后选择属性。选择Java构建路径→库选项卡。寻找一个JVM。如果不存在,请单击添加库并添加默认的JVM。如果存在VM,请单击编辑,然后选择默认的JVM。

If that doesn't resolve the issue try right-clicking on your project and select properties. Select Java Build Path → Library tab. Look for a JVM. If it's not there, click to add Library and add the default JVM. If VM is there, click edit and select the default JVM. Hopefully, that works.

编辑2:

您也可以尝试放入您拥有所有项目的文件夹,并删除 .metadata 进行蚀(请注意,之后必须重新导入所有项目!所有环境您设置的设置也必须重做)。删除后,只需再次导入该项目即可,希望它可以正常工作。

You can also try going into the folder where you have all your projects and delete the .metadata for eclipse (be aware that you'll have to re-import all the projects afterwards! Also all the environment settings you've set would also have to be redone). After it was deleted just import the project again, and hopefully, it works.

这篇关于Eclipse Oxygen-由于构建路径不完整,因此未构建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 23:36