特性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.Selector
set 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.
-
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.
-
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
.
-
-
Hardware intrinsics were added to use Advanced Encryption Standard (AES). The
UseAES
andUseAESIntrinsics
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.
-
Java Mission Control 5.3 Release Notes
- JDK 8 includes Java Mission Control 5.3.