eclipse 无法运行导入的项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4497076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to run imported project
提问by Goi
I have a few projects that were previously tested to be working in 1 PC.
我有几个项目以前经过测试可以在 1 台 PC 上运行。
I've since moved to another Windows XP PC, and I've setup the development tools on this XP system. I've downloaded and installed the following in order:
1. Eclipse Classic 3.6.1
2. JDK v6(jdk-6u23-windows-i586.exe)
3. Android SDK Tools rev8(installer_r08-windows.exe)
4. SDK Platform v2.3/2.2, Google APIs, Android API8, rev2, Google USB driver, rev4
5. ADT 8.0.1
从那以后,我搬到了另一台 Windows XP PC,并在这个 XP 系统上设置了开发工具。我已按顺序下载并安装了以下内容:
1. Eclipse Classic 3.6.1
2. JDK v6(jdk-6u23-windows-i586.exe)
3. Android SDK Tools rev8(installer_r08-windows.exe)
4. SDK Platform v2.3/2.2, Google APIs, Android API8, rev2, Google USB driver, rev4
5. ADT 8.0.1
I created a new empty project just to make sure things are working, and I seem to be able to get that new project to run on the emulator just fine. However, when I imported an existing project into the workspace, I get a bunch of errors, such as: "The import java.util cannot be resolved" "The import android cannot be resolved"
我创建了一个新的空项目只是为了确保一切正常,而且我似乎能够让这个新项目在模拟器上运行得很好。但是,当我将现有项目导入工作区时,出现一堆错误,例如:“无法解析导入的 java.util”“无法解析导入的 android”
When I look at Project Properties->Java Build Path, it shows "Unable to get system library for the project" under "Libraries" and "Order and Export". What's wrong?
当我查看“项目属性”->“Java 构建路径”时,它在“库”和“订购和导出”下显示“无法获取项目的系统库”。怎么了?
I've also tried copying and pasting the .java files and main.xml files from the imported project to the new project, and it runs correctly...but somehow the imported project doesn't.
我还尝试将 .java 文件和 main.xml 文件从导入的项目复制并粘贴到新项目中,并且它运行正常......但不知何故导入的项目没有。
Thanks.
谢谢。
回答by MindWire
- Right click on project name, open properties.
- Select Java Build Path (from left menus)
- Under the "Libraries" tab, find the entry 'Unable to get system library for project', select it then click on the Remove button.
- Select Android (from left menus), tick on the version of android you want to target.
- Select Project menu (main top level menu), select Clean... Select OK.
- Right click on project name again, go down to Android Tools > Fix Project Properties.
- 右键单击项目名称,打开属性。
- 选择 Java Build Path(从左侧菜单中)
- 在“库”选项卡下,找到条目“无法获取项目的系统库”,选择它,然后单击“删除”按钮。
- 选择 Android(从左侧菜单中),勾选您要定位的 android 版本。
- 选择 Project 菜单(主顶级菜单),选择 Clean... 选择 OK。
- 再次右键单击项目名称,转到 Android 工具 > 修复项目属性。
That should do the trick and add Android X.X (version you selected) to your project, and the imported project should start working.
这应该可以解决问题并将Android XX(您选择的版本)添加到您的项目中,导入的项目应该开始工作。
Enjoy.
享受。
回答by apptracke
I think your project does not have project target name or missing. And it's simple go to main menu : project->properties->android
(from left panel) then mark a project target name as you need for your project. After this it should work if not then clean your project like this : project->clean..>select
(clean projects selected below )->
mark your project then click ok
. thanks
我认为您的项目没有项目目标名称或缺失。转到主菜单很简单:(project->properties->android
从左侧面板)然后根据项目需要标记项目目标名称。在此之后,它应该可以工作,如果没有,则像这样清理您的项目:(project->clean..>select
在下面选择清理项目)->
标记您的项目,然后单击ok
。谢谢
回答by maatik5
- Click on Run Configurations
- Click on icon at top left corner(New launch configuration)
- Choose Project
- Click run !
- 点击运行配置
- 点击左上角的图标(新的启动配置)
- 选择项目
- 点击运行!