Eclipse not recognizing Strings and Classes

喜欢而已 提交于 2019-12-10 15:50:30

问题


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.

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

Does anyone have an idea?

BTW: XML works fine.


回答1:


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.

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.




回答2:


Redownload the JDK, this will automatically update Eclipse.



来源:https://stackoverflow.com/questions/13422683/eclipse-not-recognizing-strings-and-classes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!