The project was not built since its build path is incomplete. Can not find

错误提示:The projectwas not built since its build path is incomplete. Cannot find theclass file for java.lang.Object. Fix the build path then trybuilding this project

The type java.lang.Object cannot be resolved. It is indirectlyreferenced from required .class files

        配置好Eclipse后,新建一个项目(android),出现了上述问题。大家可能也会碰到,再次分享一下。

        通常安装完jdk后,在Program files/java/目录下会有两个文件夹:jdk**,jre。

        Eclipse在创建项目时应该参照jdk目录下的jre路径,有了这个jre之后,有时候会干扰。所以我们指明一下就可以了:

        1,进入window——preference——java——installed jres

        2,点击add——standard vm——jre home指明到的你的jdk路径,例如:C:\Program Files\Java\jdk1.7.0_51(这时jre name会自动生成)

        3,右击你的项目——properties——Java build path

            选中libraries

            add library——jre system library——installed jre(workspace default)

       4,删除Eclipse自动生成的在进入window——preference——java——installed jres 目录下的jre(否则下次你需要重复上次操作)

你可能感兴趣的:(小知识点)