Android的Eclipse类路径 - 想要添加的类路径容器路径,但日食不会让我 [英] Android Eclipse Classpath - want to add classpath container path but eclipse won't let me

查看:127
本文介绍了Android的Eclipse类路径 - 想要添加的类路径容器路径,但日食不会让我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse学习Java开发Android应用程序。我以前从未使用过Eclipse。

该项目中,我试图用(由奥莱利为Android应用开发的一部分提供)是MJAndroid。当试图运行项目,运行失败,问题选项卡中提到com.java.Object无法找到,Eclipse询问我检查了构建路径。点击 属性 - > Java构建路径 - >库,显示消息无法获取该项目的系统库

在一个工作项目,属性 - > Java构建路径 - >库已经为Android 1.1,而如果我点击编辑,有com.android.ide.eclipse.adt.ANDROID_FRAMEWORK的类路径容器路径条目

这似乎增加了正确的容器路径,以我的非工作项目的一个简单的事情。但是Eclipse的似乎决心使这个尽可能困难。不管我选择添加 - 罐,外部罐,变量,库,类文件夹,外部类的文件夹,似乎没有采取com.android.ide.eclipse.adt.ANDROID_FRAMEWORK'形式的'安卓1.1在工作​​程序条目有。

怎么会这样命名空间添加到我的项目,所以它类似​​于工作呢?

我敢肯定它与Eclipse的有些奇怪的用户界面的一个问题。坦率地说有'什么我preFER不止一个文件进行修改和设置这样的信息 - 我的背景是在Python,和整个月食环境似乎是一个不必要的负担

解决方案

我面临着同样的问题,当我输入从互联网上下载的样本code。我使用Android SDK中1.5与0.9 ADT插件。这里有一个简单的方法来解决这个andoid库参考的问题

  • 右键单击其中有项目 问题并选择属性
  • 选择合适的Andr​​oid版本 (1.1,1.5或1.5与谷歌API)和 说好
  • 再次右键单击该项目, 选择机器人工具>修复项目 属性
  • 修复导入一次(如果需要的话)
  • 刷新该项目,你应该 蓄势待发无需任何手动 编辑

I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.

The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.

On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.

It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has.

How can I add this namespace to my project so it resembles the working one?

I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.

解决方案

I had faced the same issue when I imported a sample code downloaded from the internet. I am using android sdk 1.5 with 0.9 ADT plugins. Here is a simpler way to fix the andoid library reference issues

  • Right click on the project which has issues and select properties
  • Select the appropriate Android build (1.1, 1.5 or 1.5 with google api) and say ok
  • Again right click on the project and select "Android Tools > Fix Project Properties"
  • Fix the imports once (if required)
  • Refresh the project and you should be ready to go without any manual editing

这篇关于Android的Eclipse类路径 - 想要添加的类路径容器路径,但日食不会让我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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