不能在Eclipse导入java.awt.geom中 [英] can't import java.awt.geom in eclipse

查看:1264
本文介绍了不能在Eclipse导入java.awt.geom中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始工作的一个新的Eclipse Android项目,并希望利用类的java.awt.geom包。我有OpenJVM 1.6和安装了Sun JDK 1.6,无论是从Debian的仓库。当我尝试导入包,它说,进口不能得到解决(事实上,Eclipse的自动完成只显示AWT和awt.font)。

I just started working on a new Eclipse Android project and want to make use of classes in the java.awt.geom package. I have OpenJVM 1.6 AND sun 1.6 jdk installed, both from debian's repositories. When I try to import the package, it says that the import cannot be resolved (in fact, Eclipse's auto-complete only shows awt and awt.font).

我是超越困惑,这是为什么,因为我看着设立在我的Eclipse的JRE系统库做:窗口> preferences>的Java>已安装的JRE>编辑.. 。我看,我有的rt.jar 包括,当我找到磁盘上的瓶子,并检查它的内容是罐子英尺的rt.jar ,我发现它包含< STRONG>的Java / AWT / GEOM 类。

I am beyond confused as to why this is, as I looked at the JRE system libraries set up in my Eclipse by doing: Window > Preferences > Java > Installed JREs > Edit... and I see that I have rt.jar included, and when I locate the jar on disk and examine it's contents with jar ft rt.jar, I see that it contains java/awt/geom classes.

有谁知道为什么我不能在Eclipse中导入这个包?

Does anybody know why I can't import this package in Eclipse?

感谢

推荐答案

Android不严格地使用JRE库。其中有些是可以,其中一些都没有,这取决于Android SDK中包含。机器人项目的构建针对Android的SDK,它(因为它似乎)不具有库。

Android doesn't strictly use the JRE libraries. Some of them are available and some of them aren't, depending on what the Android SDK includes. Android projects are built against the Android SDK, which (as it appears) doesn't have that library.

有关什么样的Andr​​oid SDK中的确实的包括到源:谷歌,并签了参考选项卡为Android的特定版本你正在构建对

For the official list of what the Android SDK does include, go to the source: Google, and checkout the "Reference" tab for the specific version of Android you're building against.

这会导致一些混乱,我知道了。虽然很多Android SDK的使用许多熟悉的东西从官方(或打开)JDK,他们在技术上不一样的。

This causes some confusion, I know. While much of the Android SDK uses many of the familiar things from the official (or Open) JDK, they're technically not the same.

此外,答案之一为什么Android的使用Java?解释说,中的来源$ C ​​$ C 的为Android是爪哇(在语言的语法,结构等方面),但是,当编译成字节code,不使用JDK 的。

Also, one of the answers to Why does Android use Java? explains that the source code for Android is Java (in terms of the language syntax, structure, etc.), but when compiled to bytecode, it doesn't use the JDK.

这篇关于不能在Eclipse导入java.awt.geom中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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