Eclipse无法识别字符串和类 [英] Eclipse not recognizing Strings and Classes

查看:168
本文介绍了Eclipse无法识别字符串和类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我保存了一个由eclipse构建的项目,然后我的计算机死了。修复并重新格式化后,我重新下载了eclipse等。
实际上,当我按 eclipse.exe时,它向我显示了eclipse juno图标,但是窗口的名称是Java-ADT,并且看起来有些不同。
我已经安装了ADT插件和所有Android API,但是当我导入项目时,当打开项目时,类会说,它无法识别任何内容。
我的意思是,字符串,类,导入,android,什么都没有。

I've had a project built by eclipse saved, then my computer sort of died. When I fixed it and reformatted I redownloaded eclipse and such. Actually, when I press on "eclipse.exe" it shows me the eclipse juno icon but the window's name is Java- ADT and and it looks kind of differently. I've installed the ADT Plugin and all the Android APIs but when I import my project, when it opens the classes lets say, it doesn't recognize anything. I mean, Strings, classes, imports, android, nothing.

它说:导入的android无法解析。
或:无法将字符串解析为类型。

It says: The import android cannot be resolved. Or: String cannot be resolved as a type.

有人有想法吗?

顺便说一句:XML可以正常工作。

BTW: XML works fine.

推荐答案

转到菜单(Windows)->首选项-> Java->已安装JRE ,并确保您的JRE可用并且已选择合适的JRE。如果不是(我希望是这种情况),请使用右侧的添加按钮并浏览JRE安装位置来添加库。

Go to Menu(Windows) ->Preferences -> Java -> Installed JREs and make sure your JREs are available and appropriate one is selected. If not (I hope, that's the case), add the libraries by using Add button in the right side and browsing the JRE installed location.

除了上述步骤外,请转到右键单击(项目)->属性-> Java构建路径->库。再次确保正确的库和罐子被选中并有效。如果没有,请添加/更正它们。

In addition to above step, go to Right Click(project) -> properties -> Java Build Path -> libraries. Again make sure, right libraries and Jars are selected there and valid. If not, add/correct them.

这篇关于Eclipse无法识别字符串和类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆