`

jdk1.8 新特性

 
阅读更多

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 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.

    • 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

    • Classes in the newjava.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 Profilescontain 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.

  • Security

    • Client-side TLS 1.2 enabled by default

    • New variant ofAccessController.doPrivilegedthat 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

    • 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 typejava.security.DomainLoadStoreParameter, and the new command option-importpasswordfor the keytool utility

    • SHA-224 Message Digests

    • Enhanced Support for NSA Suite B Cryptography

    • Better Support for High Entropy Random Number Generation

    • Newjava.security.cert.PKIXRevocationCheckerclass for configuring revocation checking of X.509 certificates

    • 64-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

  • JavaFX

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

    • The newSwingNodeclass enables developers to embed Swing content into JavaFX applications. See theSwingNodejavadoc andEmbedding Swing Content in JavaFX Applications.

    • The new UI Controls include theDatePickerand theTreeTableViewcontrols.

    • Thejavafx.printpackage provides the public classes for the JavaFX Printing API. See thejavadocfor more information.

    • The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The newShape3D(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 theGetting Started with JavaFX 3D Graphicsdocument.

    • TheWebViewclass provides new features and improvements. ReviewSupported Features of HTML5for 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 thejavafx.cssjavadoc for more information.

    • The newScheduledServiceclass 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.

  • Tools

    • Thejjscommand is provided to invoke the Nashorn engine.

    • Thejavacommand launches JavaFX applications.

    • Thejavaman page has been reworked.

    • Thejdepscommand-line tool is provided for analyzing class files.

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

    • Thejarsignertool has an option for requesting a signed time stamp from a Time Stamping Authority (TSA).

    • Javac tool

      • 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 thejavaccommand.

      • Thejavactool 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.

      • Thejavactool 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.

    • Javadoc tool

      • Thejavadoctool supports the newDocTreeAPI that enables you to traverse Javadoc comments as abstract syntax trees.

      • Thejavadoctool 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 thejavadoc what's newpage for more information.

      • Thejavadoctool 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.

  • Internationalization

    • 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

  • Deployment

    • 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.

  • Scripting

  • Pack200

    • 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

  • IO and NIO

    • NewSelectorProviderimplementation 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.jarfile

    • Performance improvement for thejava.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

  • JDBC

    • The JDBC-ODBC Bridge has been removed.

    • JDBC 4.2 introduces new features.

  • Java DB

    • JDK 8 includes Java DB 10.10.

  • Networking

    • The classjava.net.URLPermissionhas been added.

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

  • Concurrency

    • Classes and interfaces have been added to thejava.util.concurrentpackage.

    • Methods have been added to thejava.util.concurrent.ConcurrentHashMapclass to support aggregate operations based on the newly added streams facility and lambda expressions.

    • Classes have been added to thejava.util.concurrent.atomicpackage to support scalable updatable variables.

    • Methods have been added to thejava.util.concurrent.ForkJoinPoolclass to support a common pool.

    • Thejava.util.concurrent.locks.StampedLockclass has been added to provide a capability-based lock with three modes for controlling read/write access.

  • Java XML-JAXP

  • HotSpot

    • Hardware intrinsics were added to use Advanced Encryption Standard (AES). TheUseAESandUseAESIntrinsicsflags 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:

      -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.

分享到:
评论

相关推荐

    jdk1.8新特性

    JDK1.8新特性简介剖析,仅做参考,希望大家相互学习 作为Comparator 和Runnable早期的证明,在JDK中已经定义的接口恰巧作为函数接口而与lambdas表达式兼容。同样方式可以在你自己的代码中定义任何函数接口或第三方...

    jdk1.8新特性.doc

    本文主要介绍了JDK1.8版本中的一些新特性,仅供参考。 jdk1.8新特性知识点: 1、Lambda表达式 2、函数式接口 3、方法引用和构造器调用 4、Stream API 5、接口中的默认方法和静态方法 6、新时间日期API

    JDK1.8新特性-New Features in Java SE 8

    JDK1.8新特性,New Features in Java SE 8

    尚硅谷JDK1.8 新特性 培训PPT

    视频教程地址:http://www.gulixueyuan.com/course/56

    jdk1.8 新特性.docx

    jdk1.8新特性知识点: Lambda表达式 函数式接口 *方法引用和构造器调用 Stream API 接口中的默认方法和静态方法 新时间日期API

    JDK1.8 API 中文文档以及新特性pdf 讲解 带代码示例

    其中代码示例 jdk8的特性使用pdf 其中JDK1.8 API 中文文档以及新特性pdf 讲解 带代码示例 JDK1.8 API 中文文档以及新特性pdf 讲解 带代码示例

    JDK1.8 64位,附1.8新特性

    JDK1.8 64位,附1.8新特性JDK1.8 64位,附1.8新特性JDK1.8 64位,附1.8新特性

    jdk1.8新特性总结及使用示例

    jdk1.8新特性总结及使用示例

    JDK1.8新特性总结

    JDK1.8新特性总结+java初学者

    jdk1.8新特性代码示例

    Jdk1.8新特性代码示例

    JDK1.8下载 : jdk_8.0.1310.11_64.zip

    jdk1.8新特性: 1.Java 8允许我们给接口添加一个非抽象的方法实现,只需要使用 default关键字即可。 2.新增lambda表达式 3.提供函数式接口 4.Java 8 允许你使用关键字来传递方法或者构造函数引用 5.我们可以直接在...

    jdk1.8API文档,方便开发了解新增功能 jdk1.8接口文档

    jdk1.8API文档,方便开发了解新增功能 jdk1.8接口文档

    JDK1.8压缩包下载解压即用

    提供两种资源方式:(JDK1.8压缩包64位Windows版本)上面JDK1.8压缩包直接下载(解压一下就可以用),想自己下载的下方官网网址自行查找 官网下载地址:https://www.oracle.com/java/technologies/downloads/ JDK...

    Windows JDK1.8下载 :jdk-8u281-windows-x64.zip

    jdk1.8新特性: 1.Java 8允许我们给接口添加一个非抽象的方法实现,只需要使用 default关键字即可。 2.新增lambda表达式 3.提供函数式接口 4.Java 8 允许你使用关键字来传递方法或者构造函数引用 5.我们可以直接在...

    涵盖了90%以上的面试题

    jdk1.8新特性 java语言有哪些优点? 同一个.java文件中是否可以有多个main方法 一个".java"源文件中是否可以包括多个类(不是内部类)?有什么限制? 如何在main方法执行前输出”hello world” java程序的初始化顺序 ...

    jdk1.8.zip

    jdk1.8新特性知识点: Lambda表达式 函数式接口 *方法引用和构造器调用 Stream API 接口中的默认方法和静态方法 新时间日期API 在jdk1.8中对hashMap等map集合的数据结构优化。hashMap数据结构的优化 原来的hashMap...

    JDK1.8(32位和64位)正式版+JDK1.8API帮助文档

    jdk1.8新特性详解:(http://www.oschina.net/translate/everything-about-java-8) JDK包含的基本组件包括: javac – 编译器,将源程序转成字节码 jar – 打包工具,将相关的类文件打包成一个文件 javadoc – ...

    JDK1.8_161_jre

    jdk1.8新特性 Java 8允许我们给接口添加一个非抽象的方法实现,只需要使用 default关键字即可。 新增lambda表达式 提供函数式接口 Java 8 允许你使用 :: 关键字来传递方法或者构造函数引用 我们可以直接在lambda...

    jdk1.8 64位.zip

    JDK1.8新特性: Lambda表达式,一种新的语言特性,能够使功能作为方法参数或将代码作为数据。 • 显著增加和修改了Java语言特性,增添了标准库,包括默认方法,新的java.util.stream包及 Date-Time API。 • ...

Global site tag (gtag.js) - Google Analytics