New features in JDK 8 include: introducing Lambda expressions, providing Stream API, enabling client TLS 1.2, supporting AEAD algorithm, higher security, new Modena theme, new packages, etc.
What's new in JDK 8
Java Platform, Standard Edition 8 is a feature-rich major release. This document summarizes the features and enhancements in Java SE 8, JDK 8, and Oracle's implementation of Java SE 8. Click a component name for a more detailed description of the component's enhancements.
Java Programming Language
Lambda expressions are a new language feature that has been introduced in this version. This feature allows you to treat functions as method parameters, or code as data. Using lambda expressions, you can more concisely represent instances of single-method interfaces (called functional interfaces).
Method references provide easy-to-understand lambda expressions for methods that already have names.
The default method allows new functionality to be added to the library's interfaces and ensures binary compatibility with code written for older versions of these interfaces.
Duplicate annotations support multiple applications of the same annotation type to the same statement or type usage.
Type annotations support applying annotations anywhere a type is used, not just declarations. When combined with the pluggable type system, this feature improves type checking of your code.
Improved type inference.
Method parameter reflection.
Collection
The new java.util.stream class in the package provides a Stream API that supports Streams of elements perform functional operations. The Stream API is integrated into the Collections API and can perform batch operations on collections, such as sequential or parallel map-reduce transformations.
Performance improvements for HashMap with key conflicts
Compact profile
Includes Java SE A predefined subset of the platform and supports applications that do not require the entire platform to be deployed and run on small devices.
Security
Client TLS 1.2 is enabled by default
New changes to AccessController.doPrivileged Body supports code asserting a subset of its permissions without preventing a full stack traversal to check for additional permissions
Stronger password-based encryption algorithm
-
JSSE server-side support for SSL/TLS Server Name Indication (SNI) extension
Support for AEAD algorithm: The SunJCE provider has been enhanced to support AES/GCM/NoPadding cipher implementations as well as GCM Algorithm parameters. The SunJSSE provider has also been enhanced to support AEAD mode-based cipher suites. See Oracle Provider Documentation, JEP 115.
Keystore enhancements, including new domain keystore type java.security.DomainLoadStoreParameter and new command option -importpassword
## for the keytool utility - #SHA-224 Message Digest
- Enhanced support for NSA Suite B encryption
- Better support for high-entropy random numbers Generate
- Added the java.security.cert.PKIXRevocationChecker class for configuring the revocation check of X.509 certificates
- Applicable to Windows 64-bit PKCS11
- New rcache type added to Kerberos 5 replay cache
- Supports Kerberos 5 protocol translation and restricted delegation
- Kerberos 5 weak encryption type is disabled by default
- Unbound SASL for GSS-API/Kerberos 5 mechanism
- SASL Service for Multiple Host Names
- JNI Bridge to Native JGSS on Mac OS X
- SunJSSE Provider Support for stronger temporary DH keys in
- Support for server-side cipher suite preference customization in JSSE
JavaFX
- The new Modena theme has been implemented in this version.
- The new SwingNode class allows developers to embed Swing content into JavaFX applications. See the SwingNode javadoc and Embedding Swing content into JavaFX applications.
- New UI controls include DatePicker and TreeTableView controls.
- javafx.print package provides public classes for the JavaFX Printing API. See the javadoc for more information.
- 3D graphics features now include 3D shapes, cameras, lights, subscenes, materials, picking, and anti-aliasing. 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 related javadoc for the javafx.scene.shape.Shape3D, javafx.scene.SubScene, javafx.scene.paint.Material, javafx.scene.input.PickResult, and javafx.scene.SceneAntialiasing classes as well as the JavaFX 3D Graphics Getting Started documentation.
The WebView class contains new features and improvements. For more information about other HTML5 features, including web sockets, web workers, and web fonts, see HTML5 Supported Features.
Enhanced text support, including bidirectional text, complex text scripts (such as Thai and Hindi controls), and multi-line, multi-style text in text nodes.
This version adds support for Hi-DPI display.
CSS Styleable* classes have become public API. For more information, see the Javafx.css javadoc.
The new ScheduledService class allows automatic restart of services.
JavaFX is now available for the ARM platform. The JDK for ARM includes the base, graphics, and control components of JavaFX.
Tools
The Nashorn engine can be called through the jjs command.
java command is used to start JavaFX applications.
Rewritten the java man page.
Class files can be analyzed through the jdeps command line tool.
Java Management Extensions (JMX) supports remote access to diagnostic commands.
The jarsigner tool provides an option to request a signed timestamp from a Timestamp Authority (TSA).
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 javac command now correctly implements the type rules for equality operators in Java Language Specification (JLS) section 15.21.
Thejavac tool now supports checking the content of javadoc comments, thus avoiding various problems in the files generated when running javadoc, such as invalid HTML or accessibility issues. This feature can be enabled via a new Xdoclint option. See the output when running "javac -X" for more details. This feature is also available in the javadoc tool and is enabled by default.
javac tool now supports generating native headers on demand. This eliminates the need to run the javah tool separately in the build pipeline. This feature can be enabled in javac using the new -h option, which specifies the directory to which header files are written. A header file will be generated for annotated constant fields for any class that has a native method or uses a new annotation of type java.lang.annotation.Native .
Javadoc Tool
The javadoc tool supports the new DocTree API, allowing you to treat Javadoc comments as abstract syntax trees to traverse.
The javadoc tool supports the new Javadoc Access API, which allows you to call Javadoc tools directly from your Java application without executing a new process. For more information, see the javadoc new features page.
The javadoc tool now supports checking the content of javadoc comments, thus avoiding various problems in the files generated when running javadoc, such as invalid HTML or accessibility issues. This feature is enabled by default and can be controlled with the new -Xdoclint option. See the output when running "javadoc -X" for more details. The javac tool also supports this feature, but it is not enabled by default.
Internationalization
Unicode enhancements, including support for Unicode 6.2.0
Using Unicode CLDR data and java.locale.providers system properties
New calendar and locale API
Support Custom resource bundles are installed as extensions
Deployment
- ##It is now possible to use URLPermission to allow sandbox applets and Java Web Start apps connect back to the server that started them. SocketPermission is 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 set of new packages that provide a comprehensive date-time model.Scripting
The Rhino Javascript engine has been replaced by the Nashorn JavaScript enginePack200
- Pack200 supports constant pool entries and new bytecode introduced by JSR 292
- JDK8 supports class file changes specified by JSR-292, JSR-308 and JSR-335
IO and NIO
- New Solaris-oriented SelectorProvider implementation based on the Solaris event port mechanism. To use it, set the value of the system property java.nio.channels.spi.Selector to sun.nio.ch.EventPortSelectorProvider.
- Reduce the size of the
/jre/lib/charsets.jar file Improved the performance of java.lang.String(byte[], *) constructor and java.lang.String.getBytes() method.
java.lang and java.util packages
Parallel array sorting
Standard encoding and decoding Base64
Unsigned arithmetic support
JDBC
Removed JDBC-ODBC Bridge.
JDBC 4.2 introduces new features.
Java DB
JDK 8 includes Java DB 10.10.
Network
The java.net.URLPermission class has been added.
In the java.net.HttpURLConnection class, if a security manager is installed, the call requesting to open the connection requires permissions.
Concurrency
Some new classes and interfaces have been added to the java.util.concurrent package.
Some new methods have been added to the java.util.concurrent.ConcurrentHashMap class to support aggregation operations based on new stream tools and lambda expressions.
The java.util.concurrent.atomic package has added new classes to support extensible and updatable variables.
Some new methods have been added to the java.util.concurrent.ForkJoinPool class to support universal pools.
The new java.util.concurrent.locks.StampedLock class provides a capability-based lock that can control read/write access through three modes.
Java XML - JAXP
HotSpot
New Hardware intrinsics to use Advanced Encryption Standard (AES). The UseAES and UseAESIntrinsics flags enable hardware-based AES intrinsics for Intel hardware. 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, please use the following flags:
-XX:-UseAES -XX:-UseAESIntrinsics
Removed PermGen.
The bytecode instructions called by the method support the default methods in the Java programming language.
Java Mission Control 5.3 Release Notes
JDK 8 includes Java Mission Control 5.3.
The above is the detailed content of What are the new features of jdk8. For more information, please follow other related articles on the PHP Chinese website!

JVMmanagesgarbagecollectionacrossplatformseffectivelybyusingagenerationalapproachandadaptingtoOSandhardwaredifferences.ItemploysvariouscollectorslikeSerial,Parallel,CMS,andG1,eachsuitedfordifferentscenarios.Performancecanbetunedwithflagslike-XX:NewRa

Java code can run on different operating systems without modification, because Java's "write once, run everywhere" philosophy is implemented by Java virtual machine (JVM). As the intermediary between the compiled Java bytecode and the operating system, the JVM translates the bytecode into specific machine instructions to ensure that the program can run independently on any platform with JVM installed.

The compilation and execution of Java programs achieve platform independence through bytecode and JVM. 1) Write Java source code and compile it into bytecode. 2) Use JVM to execute bytecode on any platform to ensure the code runs across platforms.

Java performance is closely related to hardware architecture, and understanding this relationship can significantly improve programming capabilities. 1) The JVM converts Java bytecode into machine instructions through JIT compilation, which is affected by the CPU architecture. 2) Memory management and garbage collection are affected by RAM and memory bus speed. 3) Cache and branch prediction optimize Java code execution. 4) Multi-threading and parallel processing improve performance on multi-core systems.

Using native libraries will destroy Java's platform independence, because these libraries need to be compiled separately for each operating system. 1) The native library interacts with Java through JNI, providing functions that cannot be directly implemented by Java. 2) Using native libraries increases project complexity and requires managing library files for different platforms. 3) Although native libraries can improve performance, they should be used with caution and conducted cross-platform testing.

JVM handles operating system API differences through JavaNativeInterface (JNI) and Java standard library: 1. JNI allows Java code to call local code and directly interact with the operating system API. 2. The Java standard library provides a unified API, which is internally mapped to different operating system APIs to ensure that the code runs across platforms.

modularitydoesnotdirectlyaffectJava'splatformindependence.Java'splatformindependenceismaintainedbytheJVM,butmodularityinfluencesapplicationstructureandmanagement,indirectlyimpactingplatformindependence.1)Deploymentanddistributionbecomemoreefficientwi

BytecodeinJavaistheintermediaterepresentationthatenablesplatformindependence.1)Javacodeiscompiledintobytecodestoredin.classfiles.2)TheJVMinterpretsorcompilesthisbytecodeintomachinecodeatruntime,allowingthesamebytecodetorunonanydevicewithaJVM,thusfulf


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)
