JAVA8-feature and enhancement

特性1 - JAVA编程语言的加强

  • Lambda表达式,java 8的新编程语言特色,他可以让你把一个实列的实现当作一个方法参数参入, lambda表达式让你实例化一个 只含有1个方法的接口更加简洁
  • 增加接口默认方法-并且兼容JDK老版本
  • 注解加强
  • 改善接口类型
  • 支持方法参数反射
      
      // JAVA8 自动帮你断言这个接口应该返回的泛型  Person对象命名为p   参数自己写实现方法
        Person.processPersons(roster,(Person p) -> p.getAge() >= 1
                && p.getAge() <= 4,  p -> p.printPerson());
        Person.processPersonsWithFunction(
                roster,
                p -> p.getAge() >= 1
                        && p.getAge() <= 4,
                p -> p.getEmailAddress(),
                email -> System.out.println(email)
        );
        roster.stream() .filter(
                        p ->  p.getAge() >= 1
                                && p.getAge() <= 4).map(p -> p.getEmailAddress())
                .forEach(email1 -> System.out.println(email1));

特性2 集合 Collections

增加一个新包 java.util.stream提供流式API 去支持函数式风格编程操作流中的每个元素
,这个streamAPI 继承在CollectionsApi 中, 它可以支持桶操作,比如并发的map-reduce 和有序流的转换操作

特性3 Compact Profiles 压缩平台

JAVA8包含一个精简版的Java SE平台的 可以保证不需要完整版的平台就可以部署和运行在一个小型设备上

特性4 安全改进 Security

  Client-side 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

Stronger algorithms for password-based encryption
加强password-based encryption算法

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

加密算法加强支持 AES/GCM/NoPadding cipher implementation 

密钥库加强 包含这个主要的类型`java.security.DomainLoadStoreParameter

*   SHA-224 Message Digests
*   Enhanced Support for NSA Suite B Cryptography

*   Better Support for High Entropy Random Number Generation

*   New `java.security.cert.PKIXRevocationChecker` class 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

特性5 JavaFX

new Modena 注意在这次发现的版本中已经被现实,详情请看see the blog at fxexperience.com.
new SwingNode class 能够让开发者 Swing content 去潜入JavaFX applications

新 UI Controls the DatePicker and the TreeTableView controls.

javafx.prin包提供这个Printing API See the javadoc for more information.
3d图形支持
加强文本支持 包含复杂文本脚本
支持hi-DPI 显示 已经添加到本次发行版本中
* The CSS Styleable* classes became public API. See the javafx.css javadoc for more information.

*   The new [`ScheduledService`](http://docs.oracle.com/javase/8/javafx/api/javafx/concurrent/ScheduledService.html) class 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.

特性6 Tools

*   The `jjs` command is provided to invoke the Nashorn engine.
     jjs命令可以调用Nashorn -engine

*   The `java` command launches JavaFX applications.
  Java 命令可以执行JavaFX程序
   
*   The `java` man page has been reworked.
JAVA 主页重做

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

jdeps 提供分析类文件

*   Java Management Extensions (JMX) provide remote access to diagnostic commands.
    JMX 提供远程访问JMX

jarsigne工具可以请求一个时间戳签名

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

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

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

*  特性8  javadoc 相关的优化提升 [Javadoc tool](http://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/whatsnew-8.html)

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

    *   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](http://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/whatsnew-8.html) page for more information.

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

特性9 国际化 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

特性10 部署方面 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.

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

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

新的时间集合包 提供广泛的时间模型

特性12 Scripting

*   The Rhino javascript engine has been replaced with the [Nashorn](http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/) Javascript Engine

特性13 Pack200

    Pack200 支持常量池进入和新的字节码引入-JSR 292
*   JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335
    jdk8支持类文件改变

特性14 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.Selector`set to the value `sun.nio.ch.EventPortSelectorProvider`.

SelectorProvider实现了Solaris 的Solaris 端口时间机制 去使用需要设置系统变量run with the system property java.nio.channels.spi.Selectorset to the value sun.nio.ch.EventPortSelectorProvider.

 减少了charsets.jar文件的大小

优化性能ava.lang.String(byte[], *)java.lang.String.getBytes()`

特性15 新包 java.lang and java.util Packages

*   Parallel Array Sorting
  并发数组排序
*   Standard Encoding and Decoding Base64
    标准Base64
  • Unsigned Arithmetic Support

特性16 JDBC

*   The JDBC-ODBC Bridge has been removed.

*   JDBC 4.2 introduces new features.

特性17 Java DB

*   JDK 8 includes Java DB 10.10.
  • Networking

    • The class java.net.URLPermission has been added.

    • In the class java.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 the java.util.concurrent package.

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

ConcurrentHashMap类 支持聚合操作和lambda表达式

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

java.util.concurrent.atomic` package支持可扩展的变量更新

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


*   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

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

      Note: AES intrinsics are only supported by the Server VM.

    For example, to enable hardware AES, use the following flags:



    <pre class="oac_no_warn" xml:space="preserve" style="margin: 0px; padding: 0px; list-style: none; -webkit-font-smoothing: antialiased;">-XX:+UseAES -XX:+UseAESIntrinsics
    </pre>


    To disable hardware AES use the following flags:


    <pre class="oac_no_warn" xml:space="preserve" style="margin: 0px; padding: 0px; list-style: none; -webkit-font-smoothing: antialiased;">-XX:-UseAES -XX:-UseAESIntrinsics
    </pre>

*   Removal of PermGen.

*   Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,372评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,368评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,415评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,157评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,171评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,125评论 1 297
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,028评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,887评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,310评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,533评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,690评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,411评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,004评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,659评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,812评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,693评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,577评论 2 353

推荐阅读更多精彩内容