You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/java/java8.md
+231-1Lines changed: 231 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,216 @@ Java8 新增了非常多的特性,我们主要讨论以下几个:
31
31
32
32
33
33
34
+
Java8
35
+
36
+
- Java编程语言
37
+
- Lambda表达式: 它们使您能够将功能视为方法参数,或将代码视为数据
38
+
- Method references provide easy-to-read lambda expressions for methods that already have a name.
39
+
- 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.
40
+
- Repeating Annotations provide the ability to apply the same annotation type more than once to the same declaration or type use.
41
+
- 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.
-[Compact Profiles](http://docs.oracle.com/javase/8/docs/technotes/guides/compactprofiles/) 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.
- 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
55
+
- Stronger algorithms for password-based encryption
56
+
- SSL/TLS Server Name Indication (SNI) Extension support in JSSE Server
57
+
- 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.
58
+
- KeyStore enhancements, including the new Domain KeyStore type `java.security.DomainLoadStoreParameter`, and the new command option `-importpassword` for the keytool utility
59
+
- SHA-224 Message Digests
60
+
- Enhanced Support for NSA Suite B Cryptography
61
+
- Better Support for High Entropy Random Number Generation
62
+
- New `java.security.cert.PKIXRevocationChecker` class for configuring revocation checking of X.509 certificates
63
+
- 64-bit PKCS11 for Windows
64
+
- New rcache Types in Kerberos 5 Replay Caching
65
+
- Support for Kerberos 5 Protocol Transition and Constrained Delegation
66
+
- Kerberos 5 weak encryption types disabled by default
67
+
- Unbound SASL for the GSS-API/Kerberos 5 mechanism
68
+
- SASL service for multiple host names
69
+
- JNI bridge to native JGSS on Mac OS X
70
+
- Support for stronger strength ephemeral DH keys in the SunJSSE provider
71
+
- 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](http://fxexperience.com/2013/03/modena-theme-update/).
77
+
- The new `SwingNode` class enables developers to embed Swing content into JavaFX applications. See the [`SwingNode`](http://docs.oracle.com/javase/8/javafx/api/javafx/embed/swing/SwingNode.html) javadoc and [Embedding Swing Content in JavaFX Applications](http://docs.oracle.com/javase/8/javafx/interoperability-tutorial/embed-swing.htm).
78
+
- The new UI Controls include the [`DatePicker`](http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/DatePicker.html) and the [`TreeTableView`](http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TreeTableView.html) controls.
79
+
- The `javafx.print` package provides the public classes for the JavaFX Printing API. See the [javadoc](http://docs.oracle.com/javase/8/javafx/api/javafx/print/package-summary.html) for more information.
80
+
- The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new `Shape3D` (`Box`, `Cylinder`, `MeshView`, and `Sphere` subclasses), `SubScene`, `Material`, `PickResult`, `LightBase` (`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.Shape3D`, `javafx.scene.SubScene`, `javafx.scene.paint.Material`, `javafx.scene.input.PickResult`, `javafx.scene.SceneAntialiasing`, and the [Getting Started with JavaFX 3D Graphics](http://docs.oracle.com/javase/8/javafx/graphics-tutorial/javafx-3d-graphics.htm) document.
81
+
- The `WebView` class provides new features and improvements. Review [Supported Features of HTML5](http://docs.oracle.com/javase/8/javafx/embedded-browser-tutorial/index.html) for more information about additional HTML5 features including Web Sockets, Web Workers, and Web Fonts.
82
+
- 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.
83
+
- Support for Hi-DPI displays has been added in this release.
84
+
- The CSS Styleable* classes became public API. See the [`javafx.css`](http://docs.oracle.com/javase/8/javafx/api/javafx/css/package-frame.html) javadoc for more information.
85
+
- The new [`ScheduledService`](http://docs.oracle.com/javase/8/javafx/api/javafx/concurrent/ScheduledService.html) class allows to automatically restart the service.
86
+
- JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.
- 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.
98
+
- The type rules for equality operators in the Java Language Specification (JLS) Section 15.21 are now correctly enforced by the `javac` command.
99
+
- 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.
100
+
- 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`.
- The `javadoc` tool supports the new `DocTree` API that enables you to traverse Javadoc comments as abstract syntax trees.
103
+
- 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.
104
+
- 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.
- 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.
116
+
- The Permissions attribute is required in the JAR file manifest of the main JAR file at all security levels.
117
+
118
+
-[Date-Time Package](http://docs.oracle.com/javase/8/docs/technotes/guides/datetime/index.html) - a new set of packages that provide a comprehensive date-time model.
- The Rhino javascript engine has been replaced with the [Nashorn](http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/) Javascript Engine
- Pack200 Support for Constant Pool Entries and New Bytecodes Introduced by JSR 292
127
+
- JDK8 support for class files changes specified by JSR-292, JSR-308 and JSR-335
128
+
129
+
-[IO and NIO](http://docs.oracle.com/javase/8/docs/technotes/guides/io/enhancements.html#jdk8)
130
+
131
+
- 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`.
132
+
- Decrease in the size of the `/jre/lib/charsets.jar` file
133
+
- Performance improvement for the `java.lang.String(byte[], *)` constructor and the `java.lang.String.getBytes()` method.
134
+
135
+
-[java.lang and java.util Packages](http://docs.oracle.com/javase/8/docs/technotes/guides/lang/enhancements.html#jdk8)
- Classes and interfaces have been added to the `java.util.concurrent` package.
158
+
- 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.
159
+
- Classes have been added to the `java.util.concurrent.atomic` package to support scalable updatable variables.
160
+
- Methods have been added to the `java.util.concurrent.ForkJoinPool` class to support a common pool.
161
+
- 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` and `UseAESIntrinsics` flags are available to enable the hardware-based AES intrinsics for Intel hardware. The hardware must be 2010 or newer Westmere hardware.
168
+
169
+
**Note:** AES intrinsics are only supported by the Server VM.
170
+
171
+
For example, to enable hardware AES, use the following flags:
172
+
173
+
```
174
+
-XX:+UseAES -XX:+UseAESIntrinsics
175
+
```
176
+
177
+
To disable hardware AES use the following flags:
178
+
179
+
```
180
+
-XX:-UseAES -XX:-UseAESIntrinsics
181
+
```
182
+
183
+
- Removal of PermGen.
184
+
185
+
- Default Methods in the Java Programming Language are supported by the byte code instructions for method invocation.
186
+
187
+
- [Java Mission Control 5.3 Release Notes](http://www.oracle.com/technetwork/java/javase/jmc53-release-notes-2157171.html)
188
+
189
+
- JDK 8 includes Java Mission Control 5.3.
190
+
191
+
[](javascript:mailpage()) [E-mail this page](javascript:mailpage()) [ Printer View](javascript: void 0;)
192
+
193
+
##### Resources for
194
+
195
+
- [Developers](https://developer.oracle.com/)
196
+
- [Startups](https://www.oracle.com/startup/)
197
+
- [Students and Educators](https://academy.oracle.com/en/oa-web-overview.html)
- [Method References](http://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html) are compact, easy-to-read lambda expressions for methods that already have a name.
267
+
- [Default Methods](http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html) enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older versions of those interfaces. They are interface methods that have an implementation and the `default` keyword at the beginning of the method signature. In addition, you can define static methods in interfaces.
268
+
- [New and Enhanced APIs That Take Advantage of Lambda Expressions and Streams in Java SE 8](https://docs.oracle.com/javase/8/docs/technotes/guides/language/lambda_api_jdk8.html) describe new and enhanced classes that take advantage of lambda expressions and streams.
0 commit comments