Java 8 New Features
What's New in JDK 8
https://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html
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.
-
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.
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.
-
Classes in the new
java.util.streampackage 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.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.
-
Client-side TLS 1.2 enabled by default
New variant of
AccessController.doPrivilegedthat enables code to assert a subset of its privileges, without preventing the full traversal of the stack to check for other permissionsStronger algorithms for password-based encryption
SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server
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.
KeyStore enhancements, including the new Domain KeyStore type
java.security.DomainLoadStoreParameter, and the new command option-importpasswordfor the keytool utilitySHA-224 Message Digests
Enhanced Support for NSA Suite B Cryptography
Better Support for High Entropy Random Number Generation
New
java.security.cert.PKIXRevocationCheckerclass for configuring revocation checking of X.509 certificates64-bit PKCS11 for Windows
New rcache Types in Kerberos 5 Replay Caching
Support for Kerberos 5 Protocol Transition and Constrained Delegation
Kerberos 5 weak encryption types disabled by default
Unbound SASL for the GSS-API/Kerberos 5 mechanism
SASL service for multiple host names
JNI bridge to native JGSS on Mac OS X
Support for stronger strength ephemeral DH keys in the SunJSSE provider
Support for server-side cipher suites preference customization in JSSE
-
The new Modena theme has been implemented in this release. For more information, see the blog at fxexperience.com.
The new
SwingNodeclass enables developers to embed Swing content into JavaFX applications. See theSwingNodejavadoc and Embedding Swing Content in JavaFX Applications.The new UI Controls include the
DatePickerand theTreeTableViewcontrols.The
javafx.printpackage provides the public classes for the JavaFX Printing API. See the javadoc for more information.The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new
Shape3D(Box,Cylinder,MeshView, andSpheresubclasses),SubScene,Material,PickResult,LightBase(AmbientLightandPointLightsubclasses) , andSceneAntialiasingAPI classes have been added to the JavaFX 3D Graphics library. TheCameraAPI class has also been updated in this release. See the corresponding class javadoc forjavafx.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.The
WebViewclass 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.
Support for Hi-DPI displays has been added in this release.
The CSS Styleable* classes became public API. See the
javafx.cssjavadoc for more information.The new
ScheduledServiceclass allows to automatically restart the service.JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.
-
The
jjscommand is provided to invoke the Nashorn engine.The
javacommand launches JavaFX applications.The
javaman page has been reworked.The
jdepscommand-line tool is provided for analyzing class files.Java Management Extensions (JMX) provide remote access to diagnostic commands.
The
jarsignertool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).-
The
-parametersoption of thejavaccommand can be used to store formal parameter names and enable the Reflection API to retrieve formal parameter names.The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by the
javaccommand.The
javactool now has support for checking the content ofjavadoccomments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated whenjavadocis run. The feature is enabled by the new-Xdoclintoption. For more details, see the output from running "javac -X". This feature is also available in thejavadoctool, and is enabled there by default.The
javactool now provides the ability to generate native headers, as needed. This removes the need to run thejavahtool as a separate step in the build pipeline. The feature is enabled injavacby using the new-hoption, 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 typejava.lang.annotation.Native.
-
The
javadoctool supports the newDocTreeAPI that enables you to traverse Javadoc comments as abstract syntax trees.The
javadoctool 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.The
javadoctool now has support for checking the content ofjavadoccomments for issues that could lead to various problems, such as invalid HTML or accessibility issues, in the files that are generated whenjavadocis run. The feature is enabled by default, and can also be controlled by the new-Xdoclintoption. For more details, see the output from running "javadoc -X". This feature is also available in thejavactool, although it is not enabled by default there.
-
Unicode Enhancements, including support for Unicode 6.2.0
Adoption of Unicode CLDR Data and the java.locale.providers System Property
New Calendar and Locale APIs
Ability to Install a Custom Resource Bundle as an Extension
-
For sandbox applets and Java Web Start applications,
URLPermissionis now used to allow connections back to the server from which they were started.SocketPermissionis no longer granted.The Permissions attribute is required in the JAR file manifest of the main JAR file at all security levels.
Date-Time Package - a new set of packages that provide a comprehensive date-time model.
-
The Rhino javascript engine has been replaced with the Nashorn Javascript Engine
-
Pack200 Support for Constant Pool Entries and New Bytecodes Introduced by JSR 292
JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335
-
New
SelectorProviderimplementation for Solaris based on the Solaris event port mechanism. To use, run with the system propertyjava.nio.channels.spi.Selectorset to the valuesun.nio.ch.EventPortSelectorProvider.Decrease in the size of the
<JDK_HOME>/jre/lib/charsets.jarfilePerformance improvement for the
java.lang.String(byte[], *)constructor and thejava.lang.String.getBytes()method.
java.lang and java.util Packages
Parallel Array Sorting
Standard Encoding and Decoding Base64
Unsigned Arithmetic Support
-
The JDBC-ODBC Bridge has been removed.
JDBC 4.2 introduces new features.
Java DB
JDK 8 includes Java DB 10.10.
-
The class
java.net.URLPermissionhas been added.In the class
java.net.HttpURLConnection, if a security manager is installed, calls that request to open a connection require permission.
-
Classes and interfaces have been added to the
java.util.concurrentpackage.Methods have been added to the
java.util.concurrent.ConcurrentHashMapclass to support aggregate operations based on the newly added streams facility and lambda expressions.Classes have been added to the
java.util.concurrent.atomicpackage to support scalable updatable variables.Methods have been added to the
java.util.concurrent.ForkJoinPoolclass to support a common pool.The
java.util.concurrent.locks.StampedLockclass has been added to provide a capability-based lock with three modes for controlling read/write access.
-
Hardware intrinsics were added to use Advanced Encryption Standard (AES). The
UseAESandUseAESIntrinsicsflags 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
Removal of PermGen.
Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.
Java Mission Control 5.3 Release Notes
JDK 8 includes Java Mission Control 5.3.
Java 8 New Features的更多相关文章
- Java 9 New Features
Java 9 概述 1. jdk 9 的发布.经过 4 次跳票,历经曲折的 java 9 终于终于在 2017 年 9 月 21 日发布. 2. Java 9 中哪些不得不说的新特性?java 9 提 ...
- Java 11 New Features
前言 北京时间 2018年9 月 26 日,Oracle 官方宣布 Java 11 正式发布.这是 Java 大版本周期变化后的第一个长期支持版本,非常值得关注.从官网即可下载, 最新发布的 Java ...
- [Android Tips] 22. Available Java 7 Features in Android
This only allows Java 7 language features, and you can hardly benefit from anything since a half of ...
- Java相关书籍分享
Java核心技术(卷1):基础知识(原书第9版) [Core Java Volume I-Fundamentals (Ninth Edition)].pdf Java核心技术(卷2):高级特性(原书第 ...
- 【转】Java 8十个lambda表达式案例
1. 实现Runnable线程案例 使用() -> {} 替代匿名类: //Before Java 8: new Thread(new Runnable() { @Override public ...
- Java性能提示(全)
http://www.onjava.com/pub/a/onjava/2001/05/30/optimization.htmlComparing the performance of LinkedLi ...
- Java theory and practice
This content is part of the series: Java theory and practice A brief history of garbage collection A ...
- Java 8十个lambda表达式案例
1. 实现Runnable线程案例 使用() -> {} 替代匿名类: //Before Java 8: new Thread(new Runnable() { @Override public ...
- 程序员要拥抱变化,聊聊Android即将支持的Java 8
WeTest 导读 Java 9预计今年也会正式发布,Java 8这个最具变革性且变革性最适于GUI程序的版本,Android终于准备正式支持.从自己开发JavaFx的感受,说一说Java 8应该使用 ...
随机推荐
- 网络编程 TCP协议:三次握手,四次回收,反馈机制 socket套接字通信 粘包问题与解决方法
TCP协议:传输协议,基于端口工作 三次握手,四次挥手 TCP协议建立双向通道. 三次握手, 建连接: 1:客户端向服务端发送建立连接的请求 2:服务端返回收到请求的信息给客户端,并且发送往客户端建立 ...
- 08-numpy-笔记-sum
求和: axis = 0 按列求和 axis = 1 按行求和 >>> import numpy as np >>> a = np.mat([[1,2,3],[4, ...
- JavaScript instanceof深度剖析以及Object.prototype.toString.call()使用
本文由segementfalt上的一道instanceof题引出: var str = new String("hello world"); console.log(str ins ...
- Pandas | 07 函数应用
要将自定义或其他库的函数应用于Pandas对象,有三个重要的方法,下面来讨论如何使用这些方法.使用适当的方法取决于函数应用于哪个层面(DataFrame,行或列或元素). 表合理函数应用:pipe() ...
- Android 开发基础入门篇: Android Studio 导入工程
最简单的方式 等待加载完就好了
- ESA2GJK1DH1K微信小程序篇: 小程序实现MQTT封包源码使用说明
说明 我为了后期能够快速的让小程序实现MQTT,我做了一个MQTT的封装. 功能的封装有助于后期快速的开发,还方便咱维护. 我后期的所有代码皆使用此封装库, 这一节,我就详细的介绍我封装的MQTT.j ...
- Python3 异常
异常 --- 程序执行时产生的事件,为Python对象 <Python学习手册>笔记 异常总是通过实例对象来识别 默认的异常处理器 --- 打印标准出错信息(包括引发的异常和堆栈跟踪-异常 ...
- List 拆分集合与 读写XML配置文件
有时候会出现需要将一个集合分成所干个集合,依次再对每组集合进行处理,想了想,用 Linq 处理就很方便 ); ).Take(); //第一组 ).Take(); //第二组 ; i < time ...
- 【Gamma】“北航社团帮”展示博客
目录 团队介绍 项目愿景 整个项目的预期典型用户 功能展示 原预期用户数量 项目使用情况数据分析 用户量变化 学生认证人数 社长认证人数 入社申请数 活动发布 新闻发布 网页端使用情况 小程序打开次数 ...
- netcore容器与配置文件操作
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.Json; using Micro ...