jdk1.8 新特性(中英文)及中文版帮助文档

JDK 8 中的新特性

What's New in JDK 8

Java Platform, Standard Edition 8 是一个拥有丰富特性的主要版本。本文档总结了 Java SE 8、JDK 8 以及 Oracle 的 Java SE 8 实现中的特性和增强。单击组件名称可获取该组件增强功能更详细的描述。

Java Platform, Standard Edition 8 is a major feature release. This document summarizes features and enhancements in Java SE 8 and in JDK 8, Oracle's implementation of Java SE 8. Click the component name for a more detailed description of the enhancements for that component.
  • Java 编程语言
    Java Programming Language
    • Lambda 表达式是一个新的语言特性,已经在此版本中引入。该特性让您可以将功能视为方法参数,或者将代码视为数据。使用 Lambda 表达式,您可以更简洁地表示单方法接口(称为功能接口)的实例。
    • Lambda Expressions, a new language feature, has been introduced in this release. They enable you to treat functionality as a method argument, or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly.
    • 方法引用为已经具有名称的方法提供了易于理解的 lambda 表达式。
    • Method references provide easy-to-read lambda expressions for methods that already have a name.
    • 默认方法允许将新功能添加到库的接口中,并确保与为这些接口的旧版本编写的代码的二进制兼容性。
    • Default methods enable new functionality to be added to the interfaces of libraries and ensure binary compatibility with code written for older versions of those interfaces.
    • 重复批注支持对同一个声明或类型的使用多次应用相同的批注类型。
    • Repeating Annotations provide the ability to apply the same annotation type more than once to the same declaration or type use.
    • 类型批注支持在使用类型的任何地方应用批注,而不仅限于声明。与可插拔类型系统结合使用时,此特性可改进代码的类型检查。
    • Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code.
    • 改进类型推断。
    • Improved type inference.
    • 方法参数反射。
    • Method parameter reflection.
  • 集合
    Collections
    • 新的java.util.stream包中的类提供了一个 Stream API,支持对元素流进行函数式操作。Stream API 集成在 Collections API 中,可以对集合进行批量操作,例如顺序或并行的 map-reduce 转换。
    • Classes in the new java.util.stream package provide a Stream API to support functional-style operations on streams of elements. The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations.
    • 针对存在键冲突的 HashMap 的性能改进
    • Performance Improvement for HashMaps with Key Collisions
  • 紧凑 profile包含 Java SE 平台的预定义子集,并且支持不需要在小型设备上部署和运行整个平台的应用。
  • 安全性
    Security
    • 默认启用客户端 TLS 1.2
    • Client-side TLS 1.2 enabled by default
    • AccessController.doPrivileged 的新变体支持代码断言其权限的子集,而不会阻止完全遍历堆栈来检查其他权限
    • New variant of AccessController.doPrivileged that enables code to assert a subset of its privileges, without preventing the full traversal of the stack to check for other permissions
    • 更强大的基于密码的加密算法
    • Stronger algorithms for password-based encryption
    • JSSE 服务器端支持 SSL/TLS 服务器名称指示 (SNI) 扩展
    • SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server
    • 支持 AEAD 算法:SunJCE 提供程序得到了增强,支持 AES/GCM/NoPadding 密码实现以及 GCM 算法参数。而且 SunJSSE 提供程序也得到了增强,支持基于 AEAD 模式的密码套件。请参阅 Oracle 提供程序文档,JEP 115。
    • Support for AEAD algorithms: The SunJCE provider is enhanced to support AES/GCM/NoPadding cipher implementation as well as GCM algorithm parameters. And the SunJSSE provider is enhanced to support AEAD mode based cipher suites. See Oracle Providers Documentation, JEP 115.
    • 密钥库增强,包括新的域密钥库类型 java.security.DomainLoadStoreParameter, 和为 keytool 实用程序新增的命令选项-importpassword
    • KeyStore enhancements, including the new Domain KeyStore type java.security.DomainLoadStoreParameter, and the new command option -importpassword for the keytool utility
    • SHA-224 消息摘要
    • SHA-224 Message Digests
    • 增强了对 NSA Suite B 加密的支持
    • Enhanced Support for NSA Suite B Cryptography
    • 更好地支持高熵随机数生成
    • Better Support for High Entropy Random Number Generation
    • 新增了 java.security.cert.PKIXRevocationChecker 类,用于配置 X.509 证书的撤销检查
    • New java.security.cert.PKIXRevocationChecker class for configuring revocation checking of X.509 certificates
    • 适用于 Windows 的 64 位 PKCS11
    • 64-bit PKCS11 for Windows
    • Kerberos 5 重放缓存中新增了 rcache 类型
    • New rcache Types in Kerberos 5 Replay Caching
    • 支持 Kerberos 5 协议转换和受限委派
    • Support for Kerberos 5 Protocol Transition and Constrained Delegation
    • 默认禁用 Kerberos 5 弱加密类型
    • Kerberos 5 weak encryption types disabled by default
    • 适用于 GSS-API/Kerberos 5 机制的未绑定 SASL
    • Unbound SASL for the GSS-API/Kerberos 5 mechanism
    • 针对多个主机名称的 SASL 服务
    • SASL service for multiple host names
    • JNI 桥接至 Mac OS X 上的原生 JGSS
    • JNI bridge to native JGSS on Mac OS X
    • SunJSSE 提供程序中支持更强大的临时 DH 密钥
    • Support for stronger strength ephemeral DH keys in the SunJSSE provider
    • JSSE 中支持服务器端加密套件首选项自定义
    • Support for server-side cipher suites preference customization in JSSE
  • JavaFX
    JavaFX
    • 本版本中实施了新的 Modena 主题。有关更多信息,请参阅 xexperience.com.
    • The new Modena theme has been implemented in this release. For more information, see the blog at fxexperience.com.
    • 新的 SwingNode 类允许开发人员将 Swing 内容嵌入到 JavaFX 应用中。请参阅SwingNode javadoc 和 将 Swing 内容嵌入 JavaFX 应用中。.
    • The new SwingNode class enables developers to embed Swing content into JavaFX applications. See the SwingNode javadoc and Embedding Swing Content in JavaFX Applications.
    • 新的 UI 控件包括 DatePickerTreeTableView 控件。
    • The new UI Controls include the DatePicker and the TreeTableView controls.
    • javafx.print 程序包为 JavaFX Printing API 提供了公共类。有关更多信息,请参阅 javadoc
    • The javafx.print package provides the public classes for the JavaFX Printing API. See the javadoc for more information.
    • 3D 图形特性现在包括 3D 形状、摄像头、灯光、子场景、材料、挑选和抗锯齿。JavaFX 3D 图形库中新增了 Shape3D (Box, Cylinder, MeshViewSphere子类 ), SubScene, Material, PickResult, LightBase (AmbientLightPointLight 子类) , 和 SceneAntialiasing API 类。此版本中的Camera API 类也已更新。请参阅 javafx.scene.shape.Shape3D, javafx.scene.SubScene, javafx.scene.paint.Material, javafx.scene.input.PickResult和, javafx.scene.SceneAntialiasing, 类的相关 javadoc 以及 JavaFX 3D 图形入门 文档。
    • The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new Shape3D (Box, Cylinder, MeshView, and Sphere subclasses), SubScene, Material, PickResult, LightBase (AmbientLight and PointLight subclasses) , and SceneAntialiasing API classes have been added to the JavaFX 3D Graphics library. The Camera API class has also been updated in this release. See the corresponding class javadoc for javafx.scene.shape.Shape3D, javafx.scene.SubScene, javafx.scene.paint.Material, javafx.scene.input.PickResult, javafx.scene.SceneAntialiasing, and the Getting Started with JavaFX 3D Graphics document.
    • WebView WebView 类包含新特性和改进。有关其他 HTML5 特性(包括 Web 套接字、Web 辅助进程和 Web 字体)的更多信息,请参阅
    • The WebView class provides new features and improvements. Review Supported Features of HTML5 for more information about additional HTML5 features including Web Sockets, Web Workers, and Web Fonts.
    • 增强了文本支持,包括双向文本、复杂文本脚本(如泰语和印地语控件)以及文本节点中的多行多样式文本。
    • Enhanced text support including bi-directional text and complex text scripts such as Thai and Hindi in controls, and multi-line, multi-style text in text nodes.
    • 此版本添加了对 Hi-DPI 显示的支持。
    • Support for Hi-DPI displays has been added in this release.
    • CSS Styleable* 类已成为公共 API。有关更多信息,请参阅 javafx.css javadoc。
    • The CSS Styleable* classes became public API. See the javafx.css javadoc for more information.
    • 新的 ScheduledService 类允许自动重新启动服务。
    • The new ScheduledService class allows to automatically restart the service.
    • JavaFX 现在可用于 ARM 平台。适用于 ARM 的 JDK 包含 JavaFX 的基础组件、图形组件和控制组件。
    • JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.
  • 工具
    Tools
    • 可通过 jjs 命令来调用 Nashorn 引擎。
    • The jjs command is provided to invoke the Nashorn engine.
    • java 命令用于启动 JavaFX 应用。
    • The java command launches JavaFX applications.
    • 重新编写了 java 手册页。
    • The java man page has been reworked.
    • 可通过 jdeps 命令行工具来分析类文件。
    • The jdeps command-line tool is provided for analyzing class files.
    • Java Management Extensions (JMX) 支持远程访问诊断命令。
    • Java Management Extensions (JMX) provide remote access to diagnostic commands.
    • The jarsigner工具提供了一个选项用于请求获取时间戳机构 (TSA) 的签名时间戳。
    • The jarsigner tool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).
    • Javac 工具

      Javac tool

      • javac 命令的 -parameters 选项可用于存储正式参数名称,并启用反射 API 来检索正式参数名称。
      • The -parameters option of the javac command can be used to store formal parameter names and enable the Reflection API to retrieve formal parameter names.
      • 命令现已正确实施了 Java 语言规范 (JLS) 第 15.21 节中的相等运算符的类型规则。 javac
      • The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by the javac command.
      • The javac工具现在支持检查 javadoc 注释的内容,从而避免在运行javadoc 时生成的文件中产生各种问题,例如无效的 HTML 或可访问性问题。可通过新的-Xdoclint 选项来启用此特性。有关更多详细信息,请参阅运行“javac-X”时的输出。此特性也可以在javac -X". This feature is also available in the javadoc工具中使用,并且默认启用。
      • The javac tool now has support for checking the content of javadoc comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when javadoc is run. The feature is enabled by the new -Xdoclint option. For more details, see the output from running "javac -X". This feature is also available in the javadoc tool, and is enabled there by default.
      • javac 工具现在支持根据需要生成原生标头。这样便无需在构建管道中单独运行 javah 工具。可以使用新的 -h 选项在 javac 中启用此特性,该选项用于指定写入头文件的目录。将为任何具有原生方法或者使用 java.lang.annotation.Native类型的新批注的类进行批注的常量字段生成头文件。
      • The javac tool now provides the ability to generate native headers, as needed. This removes the need to run the javah tool as a separate step in the build pipeline. The feature is enabled in javac by using the new -h option, which is used to specify a directory in which the header files should be written. Header files will be generated for any class which has either native methods, or constant fields annotated with a new annotation of type java.lang.annotation.Native.
    • Javadoc 工具

      Javadoc tool

      • javadoc 工具支持新的 DocTree API,让您可以将 Javadoc 注释作为抽象语法树来进行遍历。
      • The javadoc tool supports the new DocTree API that enables you to traverse Javadoc comments as abstract syntax trees.
      • javadoc 工具支持新的 Javadoc Access API,让您可以直接从 Java 应用中调用 Javadoc 工具,而无需执行新的进程。有关更多信息,请参阅 javadoc 新特性 页面。
      • The javadoc tool supports the new Javadoc Access API that enables you to invoke the Javadoc tool directly from a Java application, without executing a new process. See the javadoc what's new page for more information.
      • javadoc工具现在支持检查javadoc 注释的内容,从而避免在运行 javadoc 时生成的文件中产生各种问题,例如无效的 HTML 或可访问性问题。此特性默认为启用状态,可以通过新的-Xdoclint 选项加以控制。有关更多详细信息,请参阅运行 "javadoc -X" 时的输出。. javac 工具也支持此特性,但默认情况下并未启用它。
      • The javadoc tool now has support for checking the content of javadoc comments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated when javadoc is run. The feature is enabled by default, and can also be controlled by the new -Xdoclint option. For more details, see the output from running "javadoc -X". This feature is also available in the javac tool, although it is not enabled by default there.
  • 国际化
    Internationalization
    • Unicode 增强,包括对 Unicode 6.2.0 的支持
    • Unicode Enhancements, including support for Unicode 6.2.0
    • 采用 Unicode CLDR 数据和 java.locale.providers 系统属性
    • Adoption of Unicode CLDR Data and the java.locale.providers System Property
    • 新增日历和区域设置 API
    • New Calendar and Locale APIs
    • 支持将自定义资源包作为扩展进行安装
    • Ability to Install a Custom Resource Bundle as an Extension
  • 部署
    Deployment
    • 现在可以使用 URLPermission 允许沙盒小程序和 Java Web Start 应用连接回启动它们的服务器。不再授予 SocketPermission
    • For sandbox applets and Java Web Start applications, URLPermission is now used to allow connections back to the server from which they were started. SocketPermission is no longer granted.
    • 在所有安全级别,主 JAR 文件的 JAR 文件清单中都需要 Permissions 属性。
    • The Permissions attribute is required in the JAR file manifest of the main JAR file at all security levels.
  • Date-Time 程序包 — 一组新程序包,提供全面的日期-时间模型。
  • Date-Time Package - a new set of packages that provide a comprehensive date-time model.
  • 脚本编写
    Scripting
    • Rhino Javascript 引擎已被替换为 Nashorn JavaScript 引擎
    • The Rhino javascript engine has been replaced with the Nashorn Javascript Engine
  • Pack200
    Pack200
    • Pack200 支持 JSR 292 引入的常量池条目和新字节码
    • Pack200 Support for Constant Pool Entries and New Bytecodes Introduced by JSR 292
    • JDK8 支持 JSR-292、JSR-308 和 JSR-335 指定的类文件更改
    • JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335
  • IO 和 NIO
    IO and NIO
    • 全新的基于 Solaris 事件端口机制的面向 Solaris 的 SelectorProvider 实现。要使用它,请将系统属性java.nio.channels.spi.Selector 的值设置为 sun.nio.ch.EventPortSelectorProvider.
    • New SelectorProvider implementation for Solaris based on the Solaris event port mechanism. To use, run with the system property java.nio.channels.spi.Selector set to the value sun.nio.ch.EventPortSelectorProvider.
    • 减小 <JDK_HOME>/jre/lib/charsets.jar 文件的大小
    • Decrease in the size of the <JDK_HOME>/jre/lib/charsets.jar file
    • 提高了 java.lang.String(byte[], *) 构造函数和 java.lang.String.getBytes() 方法的性能。
    • Performance improvement for the java.lang.String(byte[], *) constructor and the java.lang.String.getBytes() method.
  • java.lang 和 java.util 程序包
    java.lang and java.util Packages
    • 并行数组排序
    • Parallel Array Sorting
    • 标准编码和解码 Base64
    • Standard Encoding and Decoding Base64
    • 无符号算术支持
    • Unsigned Arithmetic Support
  • JDBC
    JDBC
    • 删除了 JDBC-ODBC Bridge。
    • The JDBC-ODBC Bridge has been removed.
    • JDBC 4.2 引入了新特性。
    • JDBC 4.2 introduces new features.
  • Java DB
    Java DB
    • JDK 8 包含 Java DB 10.10。
    • JDK 8 includes Java DB 10.10.
  • 网络
    Networking
    • 已添加 java.net.URLPermission 类。
    • The class java.net.URLPermission has been added.
    • java.net.HttpURLConnection类中,如果安装了安全管理器,那么请求打开连接的调用需要权限。
    • In the class java.net.HttpURLConnection, if a security manager is installed, calls that request to open a connection require permission.
  • 并发性
    Concurrency
    • java.util.concurrent 程序包中新增了一些类和接口。
    • Classes and interfaces have been added to the java.util.concurrent package.
    • Methods have been added to the java.util.concurrent.ConcurrentHashMap 类中新增了一些方法,支持基于新增流工具和 lambda 表达式的聚合操作。
    • Methods have been added to the java.util.concurrent.ConcurrentHashMap class to support aggregate operations based on the newly added streams facility and lambda expressions.
    • java.util.concurrent.atomic 程序包中新增了一些类来支持可扩展、可更新的变量。
    • Classes have been added to the java.util.concurrent.atomic package to support scalable updatable variables.
    • java.util.concurrent.ForkJoinPool 类中新增了一些方法来支持通用池。
    • Methods have been added to the java.util.concurrent.ForkJoinPool class to support a common pool.
    • 新增的 java.util.concurrent.locks.StampedLock 类提供了一个基于能力的锁,可通过三种模式来控制读/写访问。
    • The java.util.concurrent.locks.StampedLock class has been added to provide a capability-based lock with three modes for controlling read/write access.
  • Java XML - JAXP
    Java XML - JAXP
  • HotSpot
    HotSpot
    • 新增的硬件内部函数以便使用高级加密标准 (AES)。 UseAESUseAESIntrinsics 标志用于为 硬件启用基于硬件的 AES 内部函数。硬件必须是 2010 年或更新的 Westmere 硬件。例如:

      要启用硬件 AES,请使用标志: -XX:+UseAES -XX:+UseAESIntrinsics

      要禁用硬件 AES,请使用标志: -XX:-UseAES -XX:-UseAESIntrinsics

    • Hardware intrinsics were added to use Advanced Encryption Standard (AES). The UseAES and UseAESIntrinsics flags are available to enable the hardware-based AES intrinsics for Intel hardware. The hardware must be 2010 or newer Westmere hardware.Note: AES intrinsics are only supported by the Server VM. For example: to enable hardware AES, use the following flags:-XX:+UseAES -XX:+UseAESIntrinsics To disable hardware AES use the following flags: -XX:-UseAES -XX:-UseAESIntrinsics
    • 删除了 PermGen。
    • Removal of PermGen.
    • 方法调用的字节码指令支持 Java 编程语言中的默认方法。
    • Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.
  • Java Mission Control 5.3 版本说明
    Java Mission Control 5.3 Release Notes
    • JDK 8 包含 Java Mission Control 5.3。
    • JDK 8 includes Java Mission Control 5.3.

引用
引用
免积分帮助文档

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

诸葛延昌

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值