Acceptant characteristics
1. JIGSAW project; modular source code
The JIGSAW project is to modularize Java code and divide JRE into components that can cooperate with each other. This is also one of the special species of Java 9. Jep is the first step towards the four steps of Jigsaw, and it will not change the real structure of JRE and JDK. Jep is to modular JDK source code, so that the compilation system can module compile and check the module boundary when constructing. This project was originally released with Java 8, but due to delay, it will be added to Java 9.
Once it is completed, it may allow custom components according to a project needs to reduce the size of RT.JAR. There are about 20,000 categories in the RT.JAR package of JDK 7 and JDK 8, but many classes have not been used in some specific environments (even in the compact distribution characteristics of Java 8, it has contained some solutions. There are class redundant). This is to enable Java to be easily applied to small computing devices (such as network devices), improve its security and performance, and also make it easier for developers to build and maintain these class libraries.
2. Simplify the process API
As of now, the ability of Java to control and manage the system is limited. For example, in order to simply obtain your program PID, you either call the local program or use some transformation solutions by yourself. More, each (system) platform needs a different implementation to ensure that you can get the right result.
It is expected that the code can get Linux Pids, and now it is the following way:
Public Static Void Main (String [] Args) Throws Exception {Process ProC = Runtime.getruntime (). Exec (New String []/bin/sh "," -c "," echo $ ppid " }); if (Proc.WaitFor () == 0) {inputStream in = PROC.GetInputStream (); int availability = in.available (); byte [] OutputBytes = New Byte [available]; ad (outputbytes); string pid = New String (outputbytes); System.out.println ("Your Pid is" + Pid);}}
In Java 9, you can change to the following ways (support all operating systems):
System.out.println ("Your Pid is" + Process.getcurrentpid ());
This update will expand the interactive ability of Java with the operating system: add some new and direct methods to process PIDS, process names and status, and enumerate multiple JVM and processes and more things.
3. Lightweight JSON API
At present, there are many Java tools for JSON, but JSON API's uniqueness is that JSON API will be part of the Java language, lightweight and use the new features of Java 8. It will be released in the java.util bag (but JSON in JSR 353 is handled in a third -party bag or other methods).
4. API of money and currency
After Java 8 introduced the API of the date and time, Java 9 introduced a new currency API to represent currency, support the conversion between currencies and various complex operations. For the specific situation of this project, visit HTTPS: //github.com/javamoney, the use instructions and examples have been given in it. The following are important examples:
// New Type: Money & FastMoney Money AMT1 = Money.of (10.1234556123456789, "USD"); // Money is a bigdecimFastMoney AMT2 = FastMoney.of (123456789, "USD" ); // FastMoney is up to 5 decimal PlacesMoney Total = amt1.add (AMT2); // The method of the money table to achieve currency of various countries: MonetaryamountFormat Germanformat = MonetaryFormats.getamountFormat (Locale.germany); System.out.pr. intln (GermanFormat.Format (Monetaryamount)); // 1.202,, 12 USD
More about JSR 354
5. Improve the mechanism of locking
The use of locking is a bottleneck that limits many Java multi -threaded application performance. The new mechanism has obtained a variety of benchmarks in improving the performance of the Java object monitor. The process is connected to the client, and many of them apply for the same resource to simulate the daily application of heavy loads.
Through such pressure testing, we can estimate the extreme throughput of JVM (the number of messages per second). JEP has achieved excellent results in 22 different tests. If the new mechanism can be applied in Java 9, the application can be applied, the application can be applied, the application can be applied, and the application is applied to the application, the application can be applied, and the application is applied, and the application is applied, and the application is applied, and the application is applied, and the application is applied, and the application can be applied. The performance of the program will be greatly improved.
More content about JEP 143
6. Code segment cache
Another performance improvement of Java 9 comes from JIT (Just-in-Time) compiler. When a certain code is repeatedly executed, the virtual opportunity compiles this code into a machine code and stores it on the code cache Instead, the efficiency of the compiler is improved by accessing different segments in the cache.
Different from the original single cache area, the new code cache is divided into three types according to the life cycle of the code itself:
-Onding code (JVM built -in/ non -method code)
-The short -term code (Profiled code applicable only under certain conditions)
-The long -term code (non -configuration code)
The cache segments will improve the performance of the program in all aspects. For example, when doing garbage recycling and scanning, you can directly skip the non -method code (forever code) to improve efficiency.
More about JEP 197
7. Intelligent java compilation, the second stage
The first phase of the intelligent Java compilation tool SJAVAC began at the JEP 139 project to increase the compile speed of JDK on the multi -core processor. Now this project has entered the second stage (JEP 199), the purpose is to improve SJAVAC and make it become it become it become it and make it become it. Replace the Java default universal compilation tool of Java compile tool.
Other content worth looking forward to:
8. http 2.0 client
Although the HTTP 2.0 standard has not yet been officially released, it has entered the final review stage. It is expected that the review can be completed before the release of Java 9. JEP 110 will redefine and realize a new Java HTTP client to replace the current HTTPURLCONNECTION, At the same time, HTTP 2.0 and network interface (original WebSockets) will be implemented. It has not been officially recognized by JEP but we hope to include the content of this project in Java 9.
The official HTTP 2.0 RFC (a series of document records, etc.) is scheduled to be released in February 2015. It is based on Google's SPDY (Speedy, Quick) protocol. The network has a significant acceleration between 11.81%and 47.7%compared to the network based on the HTTP 1.1 protocol. Now there are browsers to implement this protocol.
9. Kulla Plan: Java's REPL implementation
This project named Kulla has recently announced that it will be integrated in April 2015. Although it is no longer hopeful to catch up with the release of Java 9, if the progress is fast, it may just catch up. The REPL (Read-Eval-Print-Loop) method, that is to say, if you want to run a few lines of Java code for a fast test, you still need to encapsulate these lines in items or methods. There is a Java REPL tool in the IDE, but they do not have official support, and the Kulla project may be the official REPL solution released by Java.
More about the Kulla plan
Where do these new features come from?
JEP and JSR are not out of nothing. Let's introduce the ecological environment of Java development:
Group-For specific technical content, such as security, network, swing, hotspot, organization and individual with common interest
Project-Writing code, documents, and other work, at least sponsored and supported by a group, such as the recent Lambda program, the JIGSAW plan and the Sumatra program.
JDK Improvement Proposal (JEP) -Whenever new attempts are needed, JEP can propose informal specifications before or at the same time before or at the same time of JCP (Java Community Process). The roadmap and allocate version number.
Java Norm Proposal (JSR) -The new features appear at this stage, which can come from group/ items, JEP, JCP members or Java communities (Community) members. Each Java version is supported by the corresponding JSR, java 9 No yet.