简体   繁体   English

Eclipse无法识别字符串和类

[英]Eclipse not recognizing Strings and Classes

I've had a project built by eclipse saved, then my computer sort of died. 我已经保存了一个由eclipse构建的项目,然后我的计算机崩溃了。 When I fixed it and reformatted I redownloaded eclipse and such. 修复并重新格式化后,我重新下载了eclipse等。 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. 实际上,当我按下“ eclipse.exe”时,它显示了eclipse juno图标,但是窗口的名称是Java-ADT,并且看起来有些不同。 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. 我已经安装了ADT插件和所有Android API,但是当我导入项目时,打开类时可以说,它无法识别任何内容。 I mean, Strings, classes, imports, android, nothing. 我的意思是,字符串,类,导入,android,什么都没有。

It says: The import android cannot be resolved. 它说:无法解析导入的android。 Or: String cannot be resolved as a type. 或:字符串无法解析为类型。

Does anyone have an idea? 有人有主意吗?

BTW: XML works fine. 顺便说一句:XML工作正常。

Go to Menu(Windows) ->Preferences -> Java -> Installed JREs and make sure your JREs are available and appropriate one is selected. 转到Menu(Windows) ->Preferences -> Java -> Installed JREs ,并确保您的JRE可用并选择了合适的JRE。 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. 如果没有(我希望是这种情况),请使用右侧的“ Add按钮并浏览JRE安装位置来Add库。

In addition to above step, go to Right Click(project) -> properties -> Java Build Path -> libraries . 除上述步骤外,转到“ 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. 如果不是,请添加/更正它们。

重新下载JDK,这将自动更新Eclipse。

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

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