是否可以使用 Java 8 进行 Android 开发?

编程入门 行业动态 更新时间:2024-10-26 02:31:51
本文介绍了是否可以使用 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 语言功能

我们决定将对 Java 8 语言功能的支持直接添加到当前的 javac 和 dx 工具集中,并弃用 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 中从窗口菜单 → Preferences → 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 → Preferences → Java → Compiler. Java 7 will works too:

Java -> 编译器">

如果您的目标是 Android 5.0 和更高.

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

安装多个JDK并尝试.

install multiple JDK and try.

更多推荐

是否可以使用 Java 8 进行 Android 开发?

本文发布于:2023-11-30 14:51:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650399.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   Java   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!