在Eclipse(Android版)错误:java.lang.String类型不能得到解决。这是间接地从必需的.class文件中引用 [英] Error in Eclipse (for Android): The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

查看:161
本文介绍了在Eclipse(Android版)错误:java.lang.String类型不能得到解决。这是间接地从必需的.class文件中引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行,别人已经创造了一个Android项目。 我已经打开了该项目在Eclipse为:

I am trying to run an Android project that someone else has created. I have opened the project in Eclipse as:

File --> New --> Project --> Android Project from existing code

下面是前两行的Java文件之一:

Here are the first two lines of one of Java files:

package aa.bb.cc;

import java.io.File;

有这些行的开头红十字标志,当我将鼠标悬停他们,我得到这个消息的第一行:的java.lang.Object不能解析的类型。这是间接地从必需的.class文件中引用 anfd第二行得到这样的信息:导入java.net解决不了

There is red cross sign at the beginning of these lines and when I hold the mouse over them I get this message for the first line: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files anfd for the second line get this message: The import java.net cannot be resolved.

的原因是什么?如何解决这些错误信息?

What is the reason and how can I resolve these error messages?

感谢。

推荐答案

执行一个步骤之前运行:

Do one more step before running:

Right Click(Project) -> Properties -> Java Build Path -> Libraries -> 
                                          Add Library -> Select the Java Library

点击确定,然后清洁构建(项目 - >清洁&安培; 项目 - >全部构建按Ctrl + B )的项目。它应该是罚款。

Click OK and then clean-build (Project -> Clean & Project -> Build All or Ctrl+B) your project. It should be fine.

这篇关于在Eclipse(Android版)错误:java.lang.String类型不能得到解决。这是间接地从必需的.class文件中引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆