score:46

Accepted answer

it seems that you lack jdk (java.lang.object comes from there )

the problem is that you used the same android api on different pc. eclipse is lost with path names that are differents but with same api.

to solve it, first re-select android api version (set to another one and valid, then restore the on you want and validate it -> it will force eclipse to reload api). then go into project->properties-> java build path. then remove "unable to get system library for the project" then "add library" and select "android classpath container".

score:0

i had to delete r.java in the gen folder, then do a clean build. this solved my issue.

score:0

steve's answer does help for some projects, but still, for some projects, it remains the same. i guess that projects were previously build-in early jdk 1.5 (in my case). but i found a workaround for them:

  1. find the class that causes the problem (keep expanding the project in the package explorer).
  2. copy the class's contents after the import block.
  3. delete the whole class.
  4. right click on the project then android tools >> fix project properties
  5. create a class with the same name under the same package the deleted class was before. (if the project is imported and the deleted class was an activity/service/provider/reciever, i guess the class is already included in the androidmanifest.xml).
  6. paste the content of the class and import packages.
  7. clean the project.

score:0

i've had similar problem. exact same error, but in ubuntu after i worked on project in dropbox folder from windows. i've just added android.jar to project. somehow it disappeared from build path.

score:0

for me this problem was related to openjdk 6 on ubuntu.

update your jre or install sun's proprietary jre instead and restart eclipse.

score:0

i know this is too late. but i am also facing this issue and i fix this by following below steps.

  1. this issue is occurred only if the project shared between different machines.
  2. for me i found java jdk is the problem.
  3. my colleague used mac system and using jdk 1.7. but in my system i used jdk 1.6.
  4. i guess that may be the issue. so i select project and open properties and change my jdk to 1.7
  5. change target=google inc.:google apis:19
  6. clean & build

finally issue is fixed. i think this is because of if you build your project with higher jdk version thereafter you should build with same version.

note : we are not facing this issue before until my colleague build with jdk 1.7. after he started to using jdk 1.7 only this issue occur.

hope it will work for some one. and no need for install new eclipse.

score:0

i had my "build automatically" turned off in "project". i turned it off, because the eclipse was not loading the projects correctly, for various unknown reasons. turning this on, solved my problem.

score:0

if the project is not very big, you can copy the packages and paste it into a new project, you won't see the errors in the new project.

score:0

i was having target-18 in my project.properties. but i wasn't having android-18 sdk. so i changed 18 to some other version which i had in my sdk manager, and it fixed the issue.

score:0

you just exit eclipse once or twice to reload. it works for me.

score:1

i encountered with the similar problem..... make sure that

  1. you create your project within your workspace. if your project is not in the default workspace where .metadata folder within which other plugin folders, and etc. will be present, then it will ask you to configure build path as the project is not build because of incomplete build path.

if the first step is clear, then go for this.....

  1. right click on your project -> build path -> configure build path -> libraries -> add libraries -> jre system libraries -> apply and close.

score:2

i have seen such errors in past while importing projects in eclipse. the solution to that is to go to properties->android and select project build target appropriately (android x.x.x or google apis)

score:2

was struggling with this while trying to load the vuforia sample app for way too long today. the solution that finally got my project to build was:

1) window->android sdk manager and install the latest updates
2) project->build path->configure build path->android and under project build target mark android 4.4.2 and click ok
3) clean, build and run

i hope this solves somebody else's issue as well, eclipse is frustrating as f$#@!!!

score:3

goto eclipse → preferences → java → build path.

do you see a jre_lib configured there? if not, add jre_lib from jdk/jre lib location. these can be overridden per project. it seems your eclipse isn't aware of java libraries.

score:3

none of this worked for me. i created a new workspace for the projects. that worked for me! switching to a new workspace usually miraculously solves a lot of these configuration problems. simply create a new folder where you would want your new workspace to be and then use 'import project from existing code'.

score:4

initially i was trying to import an android project from github and encountered the above problem

  • cannot configure build path

  • unable to get system libraries


package explorer -> right click the project -> “properties” -> "android" -> "project build target" = 2.3.3

note: also try clean (on windows: project -> clean) then refresh (f5) at random. there's a good chance this will magically solve all your problems.


courtesy: kyle clegg
reference link

score:61

close eclipse and re-open worked for me. you may have to do this two or three times. each time give it a minute for the auto build startup process (check bottom right hand corner) to complete, as these errors often disappear at this time.

or try to clean the affected projects.

'turn it off and on again'

score:125

right click on project -> properties -> java build path (from left list) -> libraries (tab) -> add library (button on right) -> jre system library -> next -> workspace default jre -> finish

this should solve at least one of your errors. any others might require you to add further libraries.

hope this helps.


Related Query

More Query from same tag