是否支持Android JDK 6或7 [英] Does Android support JDK 6 or 7

查看:175
本文介绍了是否支持Android JDK 6或7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的Andr​​oid开发。我是否可以使用现有的Java code在Android中使用JDK 7开发?

I am new to Android development. Can I use my existing Java code developed using JDK 7 in Android?

该功能使用Xerces的DOM和XSLT和XPathAPI类。目前,当我安装的Andr​​oid的Eclipse ADT环境中,这些功能都没有编制。我也想知道Android设备本身是否支持JRE 6或7?

The functions use xerces dom and xslt and xpathapi. Currently when I installed Android Eclipse ADT environment these functions are not compiling. I would also like to know whether an Android device itself supports JRE 6 or 7?

推荐答案

仅支持JDK 6的功能本来Android的开发工具。但是,这改变了,首先由机器人工作室0.3.2 2013年10月见:<一href="http://tools.android.com/recent/androidstudio032released">http://tools.android.com/recent/androidstudio032released

Originally Android development tools supported only jdk 6 features. But that was changed, first by Android Studio 0.3.2 in October 2013 see: http://tools.android.com/recent/androidstudio032released

支持的语言功能,如钻石运营商,多抓,尝试与 - 资源,在开关的字符串,等等。   当创建一个新的项目,可以指定源语言水平:      请注意,您可以使用所有这些语言功能不仅与Android奇巧,但与旧版本的Andr​​oid呢!有一个例外情况:尝试与 - 资源,这将需要的minSdkVersion 19。因此,工作室将标志您的code的任何用途尝试与 - 资源,如果你的minSdkVersion小于19:

Support for language features like the diamond operator, multi-catch, try-with-resources, strings in switches, etc. When creating a new project, you can specify a source language level: Note that you can use all these language features not just with Android KitKat, but with older versions of Android too! There is one exception to that: try-with-resources, which will require minSdkVersion 19. Therefore, Studio will flag any uses in your code of try-with-resources if your minSdkVersion is less than 19:

再由ADT插件22.6在2014年3月,见:<一href="http://developer.android.com/tools/sdk/eclipse-adt.html">http://developer.android.com/tools/sdk/eclipse-adt.html

then by ADT plugin 22.6 in March 2014,see: http://developer.android.com/tools/sdk/eclipse-adt.html

增加了对Java 7的语言支持功能,如多抓,尝试与 - 资源,以及钻石运营商。这些功能要求更高版本的内部工具的19或。尝试与 - 资源要求的minSdkVersion 19;新的语言特性,其余需要的minSdkVersion 8或更高。   要在安装ADT 22.6.0后,使用新的语言功能,确保您在JDK 7中运行Eclipse和更改应用程序的项目设置以使用JDK 7。

Added support for Java 7 language features like multi-catch, try-with-resources, and the diamond operator. These features require version 19 or higher of the Build Tools. Try-with-resources requires minSdkVersion 19; the rest of the new language features require minSdkVersion 8 or higher. To use the new language features after installing ADT 22.6.0, ensure that you run Eclipse on JDK 7 and change your application project settings to use JDK 7.

机器人不旨在与任何的Java SE API的版本,而不是6也不8也没有任何兼容的100%。这是甲骨文的诉讼案件的原因提出了针对谷歌,指责分裂爪哇谷歌。有些API是不可能实现在Android上的摇摆;想象一下,有一个关闭按钮的窗口在Android上!其他被推迟,但实施:对,例如:字符集类是在Java SE 1.4,但在Android的API 9实现,AutoClosable用Java 7中的Andr​​oid API级别19执行,可以实现尝试与 - 资源的语言特性。有些API是存在的,但是对于不同用途的控制台。

Android is not intended to be 100% compatible with any Java SE API version, not 6 nor 8 nor any. this was the reason of the court case of Oracle raised Against Google, accusing Google of fragmenting Java. Some APIs are impossible to implement on android as Swing; Imagine a window with a close button on android ! Others were delayed but implemented : for e.g.: Charset class is in Java SE 1.4 but implemented in android API 9, AutoClosable in Java 7 implemented in Android API level 19 to allow implementation of try-with-resources language feature. Some APIs are existent but for different purpose as Console.

这篇关于是否支持Android JDK 6或7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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