简体   繁体   English

我的“ src”文件夹中的所有代码行在Eclipse中均存在错误

[英]All my lines of code in my 'src' folder have errors in Eclipse

在Eclipse中看到的部分代码

Am having problems with development in android as all my lines of code in all the files in the src folder where am placing my java files have errors on them. 我在android中进行开发时遇到问题,因为我放置src文件夹的src文件夹中所有文件中的所有代码行都有错误。 I do not know where the problem is coming from! 我不知道问题出在哪里!

First had problems where 'R' was underlined in red. 首先遇到的问题是用红色强调“ R”。 then after Ctrl+Shift+O, I exited my eclipse and on opening it, that's what I saw on my java files 然后在Ctrl + Shift + O之后,我退出了日食并打开它,这就是我在Java文件中看到的

Go to

Project Properties>Java Build Path>Libraries tab

and make sure JRE is added, if not, click "Add Library..." and add it. 并确保已添加JRE,如果未添加,请单击“添加库...”并添加它。

All errors seems related to Android's specific classes: 所有错误似乎都与Android的特定类有关:

  • you may have a problem with you Eclipse+ADT installation 您的Eclipse + ADT安装可能有问题

  • you may have pasted the code into the wrong type of project 您可能已将代码粘贴到错误的项目类型中

  • you may simple missing the corrisponding import 您可能会简单地缺少相应的导入

Last is simplier to verify, just hover with mouse over the error and see if Eclipse suggests you to add a specific import 最后一个验证起来更简单,只需将鼠标悬停在错误上方,然后查看Eclipse是否建议您添加特定的导入

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM