是否可以将 Java 8 用于 Android 开发? [英] Is it possible to use Java 8 for Android development?

查看:23
本文介绍了是否可以将 Java 8 用于 Android 开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网上搜了一下,Android 开发是否支持 Java 8 不清楚.

Searching the web, it is not clear if Java 8 is supported for Android development or not.

在我下载/安装 Java 8 之前,请向我指出任何说明 Java 8 支持或不支持 Android 开发的官方"文档.

Before I download/setup Java 8, can some one point me at any "official" documentation that says Java 8 is or is not supported for Android development.

推荐答案

java 8

Android 支持所有 Java 7 语言功能和 Java 8 语言功能的一个子集,这些功能因平台版本而异.

java 8

Android supports all Java 7 language features and a subset of Java 8 language features that vary by platform version.

查看支持java 8的哪些特性

To check which features of java 8 are supported

使用 Java 8 语言功能

我们决定直接在当前的 javac 和 dx 工具集中添加对 Java 8 语言功能的支持,并弃用 Jack 工具链.有了这个新方向,依赖于 Java 类文件格式的现有工具和插件应该继续工作.展望未来,Android 构建系统将原生支持 Java 8 语言功能.我们的目标是在未来几周内将其作为 Android Studio 的一部分发布,我们希望尽早与您分享这一决定.

We've decided to add support for Java 8 language features directly into the current javac and dx set of tools, and deprecate the Jack toolchain. With this new direction, existing tools and plugins dependent on the Java class file format should continue to work. Moving forward, Java 8 language features will be natively supported by the Android build system. We're aiming to launch this as part of Android Studio in the coming weeks, and we wanted to share this decision early with you.

Java 8 语言功能的未来支持安卓

对于喜欢 Eclipse 的老开发者,google 停止支持 Eclipse Android 开发者工具

For old developers who prefer Eclipse, google stops support Eclipse Android Developer tools

如果您安装了 Java 8 JDK,请尝试一下,如果出现任何问题,请尝试在 Eclipse 中从窗口菜单 → 首选项Java 中将编译器设置为 1.6→ 编译器.Java 7 也可以:

if you installed Java 8 JDK, then give it a try, if any problems appears try to set the compiler as 1.6 in Eclipse from window menu → PreferencesJavaCompiler. Java 7 will works too:

Java -> 编译器">

如果您的目标是 Android 5.0,则需要 Java 7 或更高版本更高.

Java 7 or higher is required if you are targeting Android 5.0 and higher.

安装多个JDK并尝试.

install multiple JDK and try.

这篇关于是否可以将 Java 8 用于 Android 开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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