6

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.

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

31 Comments

Thanks Yogendra, but I'm new at this so I'm not really sure what JREs I need and the same, for libraries. I have JRE 7 checked when I enterred Installed JREs. Is that ok?
@McShpoochen: JRE --> Java Runtime Environment. Looks OK(plase validate the location mentioned is valid folder in your system and has libraries inside). Did you validate the second step as well i.e. your project level configuration?
No sorry, I don't really know what libraries and jars I need. :\
@McShpoochen: At least validate the location showing in step-1 is available in your file system. Would you mind sharing that location with me? Also check the entries in step2, and share me what all you see there.
1) jre7 - installed at C:\Program Files\Java\jre7 2) JARs and class folder on the build path: com.android.ide.eclipse.adt.LIBRARIES - Access rules: No rules defined - Native library location: (None) Unable to get system library for the project - Access rules: No rules defined - Native library location: (None)
|
0

Redownload the JDK, this will automatically update Eclipse.

3 Comments

Do I have to be specific about the version?
I couldn't find any direct link, only link from downloads site who force you to download it via their software.
I think most people asking this question are in positions where that's not an option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.