强大的JDK8新特性

JDK8新特性

What's New in JDK 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平台,标准版8是一个主要的特性发布。本文总结了Java SE 8和JDK 8 (Oracle的Java SE 8实现)中的特性和增强。单击组件名称以获得对该组件增强的更详细描述。

Java Programming Language

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表达式是一种新的语言特性,已在这个版本中引入。它们使您能够将功能视为方法参数,或将代码视为数据。Lambda表达式使您可以更紧凑地表达单方法接口(称为函数接口)的实例。

Method references provide easy-to-read lambda expressions for methods that already have a name.

方法引用为已经有名称的方法提供易于阅读的lambda表达式。

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

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.

新java.util中的类。流包提供了一个流API来支持对元素流的函数式操作。流API集成到集合API中,它支持对集合进行批量操作,例如顺序或并行的地图减少转换。

Performance Improvement for HashMaps with Key Collisions

哈希映射的性能改进

Compact Profiles contain predefined subsets of the Java SE platform and enable applications that do not require the entire Platform to be deployed and run on small devices.

紧凑概要文件包含Java SE平台的预定义子集,并支持不需要在小型设备上部署和运行整个平台的应用程序。

Security

Client-side TLS 1.2 enabled by default

客户端TLS 1.2默认启用

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

新的AccessController的变体。使代码能够断言其特权的子集,而不妨碍对堆栈的完整遍历以检查其他权限

Stronger algorithms for password-based encryption

更强的基于密码的加密算法

SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server

在JSSE服务器中支持SSL/TLS服务器名称指示(SNI)扩展

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.

对AEAD算法的支持:对SunJCE提供程序进行了增强,以支持AES/GCM/ nopadd密码实现和GCM算法参数。并增强了SunJSSE提供程序以支持AEAD模式的密码套件。参见Oracle provider文档,JEP 115。

KeyStore enhancements, including the new Domain KeyStore type java.security.DomainLoadStoreParameter, and the new command option -importpassword for the keytool utility

KeyStore增强,包括新的域KeyStore类型java.security。DomainLoadStoreParameter以及keytool实用程序的新命令选项-importpassword

SHA-224 Message Digests

SHA - 224消息摘要

Enhanced Support for NSA Suite B Cryptography

增强对NSA Suite B加密的支持

Better Support for High Entropy Random Number Generation

更好的支持高熵随机数生成

New java.security.cert.PKIXRevocationChecker class for configuring revocation checking of X.509 certificates

新的java.security.cert。PKIXRevocationChecker类,用于配置对X.509证书的撤销检查。

64-bit PKCS11 for Windows

64位PKCS11 Windows

New rcache Types in Kerberos 5 Replay Caching

Kerberos 5重放缓存中的新rcache类型

Support for Kerberos 5 Protocol Transition and Constrained Delegation

支持Kerberos 5协议转换和约束授权。

Kerberos 5 weak encryption types disabled by default

Kerberos 5弱加密类型默认禁用

Unbound SASL for the GSS-API/Kerberos 5 mechanism

GSS-API/Kerberos 5机制的未绑定SASL

SASL service for multiple host names

用于多个主机名的SASL服务

JNI bridge to native JGSS on Mac OS X

JNI桥接到Mac OS X上的本地JGSS

Support for stronger strength ephemeral DH keys in the SunJSSE provider

在SunJSSE提供程序中支持更强的短命DH键

Support for server-side cipher suites preference customization in JSSE

支持JSSE中的服务器端密码套件首选项定制

JavaFX

The new Modena theme has been implemented in this release. For more information, see the blog at fxexperience.com.

新的Modena主题已经在这个版本中实现。有关更多信息,请参阅fxexperience.com上的博客。

The new SwingNode class enables developers to embed Swing content into JavaFX applications. See the SwingNode javadoc and Embedding Swing Content in JavaFX Applications.

新的SwingNode类允许开发人员将Swing内容嵌入到JavaFX应用程序中。查看SwingNode javadoc并在JavaFX应用程序中嵌入Swing内容。

The new UI Controls include the DatePicker and the TreeTableView controls.

新的UI控件包括DatePicker和TreeTableView控件。

The javafx.print package provides the public classes for the JavaFX Printing API. See the javadoc for more information.

javafx。print包为JavaFX打印API提供公共类。有关更多信息,请参见javadoc。

The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new Shape3D (BoxCylinderMeshView, and Spheresubclasses), SubSceneMaterialPickResultLightBase (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.Shape3Djavafx.scene.SubScenejavafx.scene.paint.Materialjavafx.scene.input.PickResultjavafx.scene.SceneAntialiasing, and the Getting Started with JavaFX 3D Graphics document.

3D图形功能现在包括3D图形、照相机、灯光、子场景、材料、拾取和反锯齿。新的Shape3D (Box、Cylinder、MeshView和Spheresubclasses)、SubScene、Material、PickResult、LightBase (AmbientLight和PointLight子类)和sceneantialialize API类已经添加到JavaFX 3D图形库中。在这个版本中,还更新了Camera API类。有关javafx.scene.shape,请参见相应的类javadoc。Shape3D javafx.scene。子场景,javafx.scene.paint。材料,javafx.scene.input。PickResult javafx.scene。SceneAntialiasing,并且开始使用JavaFX 3D图形文档。

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.

WebView类提供了新的特性和改进。审查支持HTML5的特性,以获得更多有关HTML5特性的更多信息,包括Web Sockets、Web Workers和Web字体。

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.

增强的文本支持,包括双向文本和复杂的文本脚本,如控件中的泰语和印地语,以及文本节点中的多行、多样式文本。

Support for Hi-DPI displays has been added in this release.

在这个版本中添加了对Hi-DPI显示的支持。

The CSS Styleable* classes became public API. See the javafx.css javadoc for more information.

CSS样式化*类变成了公共API。看到javafx。更多信息请访问css javadoc。

The new ScheduledService class allows to automatically restart the service.

新的ScheduledService类允许自动重新启动服务。

JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.

  • JavaFX现在可用于ARM平台。JDK for ARM包含了JavaFX的基础、图形和控件组件。

Tools

The jjs command is provided to invoke the Nashorn engine.

jjs命令用于调用Nashorn引擎。

The java command launches JavaFX applications.

java命令启动JavaFX应用程序

The java man page has been reworked.

java man页面已被重新修改

The jdeps command-line tool is provided for analyzing class files.

jdeps命令行工具是用来分析类文件的。

Java Management Extensions (JMX) provide remote access to diagnostic commands.

Java管理扩展(JMX)提供对诊断命令的远程访问。

The jarsigner tool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).

jarsigner工具有一个选项,用于请求来自时间戳授权(TSA)的签名时间戳。

Javac tool

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.

javac命令的-参数选项可用于存储正式参数名,并启用反射API来检索正式参数名。

The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by the javac command.

Java语言规范(JLS)第15.21节中相等操作符的类型规则现在由javac命令正确执行。

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工具现在支持检查javadoc注释的内容,检查在运行javadoc时生成的文件中可能导致各种问题的问题,比如无效的HTML或可访问性问题。该特性由新的-Xdoclint选项启用。有关详细信息,请参见运行“javac -X”的输出。这个特性也可以在javadoc工具中使用,并且可以通过defaul实现。

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.

javac工具现在提供了根据需要生成本机头的能力。这消除了将javah工具作为构建管道中的单独步骤运行的需要。该特性在javac中是通过使用新的-h选项启用的,该选项用于指定应该写入头文件的目录。头文件将生成给任何具有本机方法的类,或使用java.lang. annotes.native类型的新注释注释的常量字段。

Javadoc tool

The javadoc tool supports the new DocTree API that enables you to traverse Javadoc comments as abstract syntax trees.

javadoc工具支持新的DocTree API,允许您将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访问API,该API允许您直接从Java应用程序调用javadoc工具,而无需执行新的进程。有关更多信息,请参见javadoc新页面。

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.

javadoc工具现在支持检查javadoc注释的内容,以发现在运行javadoc时生成的文件中可能导致各种问题的问题,比如无效的HTML或可访问性问题。该特性在默认情况下是启用的,也可以由新的-Xdoclint选项控制。有关更多细节,请参见运行“javadoc -X”的输出。这个特性在javac工具中也是可用的,尽管它在缺省情况下是不启用的。

Internationalization

Unicode Enhancements, including support for Unicode 6.2.0

Unicode增强,包括对Unicode 6.2.0的支持

Adoption of Unicode CLDR Data and the java.locale.providers System Property

采用Unicode CLDR数据和java.locale。供应商系统属性

New Calendar and Locale APIs

新的日历和语言环境api

Ability to Install a Custom Resource Bundle as an Extension

能够安装自定义资源包作为扩展

Deployment

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.

对于沙盒applet和Java Web Start应用程序,URLPermission现在被用来允许连接回到启动服务器。足球权限不再被授予。

The Permissions attribute is required in the JAR file manifest of the main JAR file at all security levels.

权限属性在所有安全级别的主JAR文件清单中都是必需的。

Date-Time Package - a new set of packages that provide a comprehensive date-time model.

日期-时间包——一组新的包,提供了一个全面的日期时间模型。

Scripting

The Rhino javascript engine has been replaced with the Nashorn Javascript Engine

Rhino javascript引擎已经被Nashorn javascript引擎所取代

Pack200

Pack200 Support for Constant Pool Entries and New Bytecodes Introduced by JSR 292

Pack200支持JSR 292引入的常量池条目和新的字节码

JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335

支持JSR-292、JSR-308和JSR-335指定的类文件更改

IO and NIO

New SelectorProvider implementation for Solaris based on the Solaris event port mechanism. To use, run with the system property java.nio.channels.spi.Selectorset to the value sun.nio.ch.EventPortSelectorProvider.

根据Solaris事件端口机制,为Solaris提供新的SelectorProvider实现。要使用,请使用系统属性java.nio.channels.spi。Selectorset设置为值sun.nio.ch.EventPortSelectorProvider。

Decrease in the size of the <JDK_HOME>/jre/lib/charsets.jar file

减少/jre/lib/charsets的大小。jar文件

Performance improvement for the java.lang.String(byte[], *) constructor and the java.lang.String.getBytes() method.

java.lang的性能改进。String(byte[], *)构造函数和java.lang.String.getBytes()方法

java.lang and java.util Packages

 

Parallel Array Sorting

并行数组排序

Standard Encoding and Decoding Base64

标准编码和解码Base64。

Unsigned Arithmetic Support

无符号运算支持

JDBC

The JDBC-ODBC Bridge has been removed.

JDBC-ODBC桥已经被删除。

JDBC 4.2 introduces new features.

  • JDBC 4.2引入了新特性。

Java DB

JDK 8 includes Java DB 10.10.

  • JDK 8包括Java DB 10.10。

Networking

The class java.net.URLPermission has been added.

添加了java.net.URLPermission类。

In the class java.net.HttpURLConnection, if a security manager is installed, calls that request to open a connection require permission.

在java.net.HttpURLConnection类中,如果安装了安全管理器,则调用该请求来打开连接需要获得许可。

Concurrency

Classes and interfaces have been added to the java.util.concurrent package.

类和接口已经添加到java.util中。并发包。

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中。ConcurrentHashMap类支持基于新添加的流工具和lambda表达式的聚合操作。

Classes have been added to the java.util.concurrent.atomic package to support scalable updatable variables.

类被添加到java.util.concurrent中。支持可升级变量的原子包。

Methods have been added to the java.util.concurrent.ForkJoinPool class to support a common pool.

方法被添加到java.util.concurrent中。ForkJoinPool类支持公共池。

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.util.concurrent.locks。已经添加了StampedLock类,以提供一种基于能力的锁,具有三种控制读/写访问的模式。

Java XML - JAXP

  •  
  •  

HotSpot

Hardware intrinsics were added to use Advanced Encryption Standard (AES). The UseAESand UseAESIntrinsics flags are available to enable the hardware-based AES intrinsics for Intel hardware. The hardware must be 2010 or newer Westmere hardware. For example, to enable hardware AES, use the following flags:

增加了硬件特性以使用高级加密标准(AES)。usea和useaesintrinsic标志可用来为Intel硬件启用基于硬件的AES intrinsic。硬件必须是2010年或更新的Westmere硬件。例如,要启用硬件AES,请使用以下标志:

-XX:+UseAES -XX:+UseAESIntrinsics

 

To disable hardware AES use the following flags:

要禁用硬件AES,请使用以下标志:

-XX:-UseAES -XX:-UseAESIntrinsics

 

Removal of PermGen.

删除PermGen。

Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.

  • Java编程语言中的默认方法由方法调用的字节代码指令支持。

Java Mission Control 5.3 Release Notes

JDK 8 includes Java Mission Control 5.3.

JDK 8包括Java任务控制5.3。

发布了105 篇原创文章 · 获赞 536 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_41934990/article/details/81449576
今日推荐