Sunday, July 24, 2016

Latest Java 9 News

To download & test the latest Java 9 build, visit  jdk9.java.net/download/


Java 9, the next major Java release, will introduce a module system for the Java SE platform and the JDK. As Java 9 work continues, you can learn about the new proposed schedule, version scheme and the latest features. You can also check out early access builds. The new proposed GA date is March 2017. Below are the full proposed milestones for Java 9:
2016/05/26 Feature Complete
2016/08/11 All Tests Run
2016/09/01 Rampdown Start
2016/10/20 Zero Bug Bounce
2016/12/01 Rampdown Phase 2
2017/01/26 Final Release Candidate
2017/03/23 General Availability
    In the meantime, early access builds are available for download and testing. You can find bundle downloads that do not require building from source.

    Note that Java 9 will have an updated JDK version string scheme. The scheme will highlight minor, major and critical patch update (CPU) releases. The new convention will follow the version string of Major.Minor.Security

    Some Java Enhancement Proposals (JEPs) have been placed into the "Proposed to Target"
    state by their owners after discussion and review. Those JEPs include:

    271: Unified GC Logging
    278: Additional Tests for Humongous Objects in G1
    279: Improve Test-Failure Troubleshooting
    280: Indify String Concatenation

    Here is a preview of some of the most intriguing proposals for JDK 9 so far.

    Using JDK 9 with Project Jigsaw in IntelliJ IDEA

    The Java platform module system, known under the codename Project Jigsaw, is the main feature of Java 9. If you’re not familiar yet with this feature, I recommend you to watch one of the talks about it, or read its design overview by Mark Reinhold.
    In short, Project Jigsaw is aimed at replacing the error-prone “classpath” with a reliable configuration as well as breaking the monolithic JDK into modules that could be deployed and used independently.
    Though the release of Java 9 is scheduled for March, 2017, an early preview of the JDK 9 with Project Jigsaw is available
    Since the implementation of the module system is under heavy development and may change, IntelliJ IDEA doesn’t provide official support for it yet. I expect it to appear closer to June, 2016 when the feature hits Feature Complete. However if you’d like to try Jigsaw with IntelliJ IDEA already, below you’ll find instructions on that. Note that the standard JDK9 can be used with IntelliJ IDEA without any limitations — just as any other JDK.

    Strings in Java 9

    Two interesting string-related features, Compact Strings and Indify String Concatenation will be part of JDK 9. JEP 254, the compact strings optimization for OpenJDK 9 will improve the footprint of Java String and related classes while preserving full compatibility for all related Java and native interfaces. JEP 280, Indify String Concatenation will enable invokedynamic to concatenate strings, to free runtime implementors for optimizing string concatenation without pushing users to recompile their programs.

    Modular source code


    The most highly anticipated change to Java 9 will be modularity. Inspired byProject Jigsaw, which was deferred from Java 8 until Java 9, the effort to modularize Java's source code will be accompanied by a build system enhanced for this capability.
    "Project Jigsaw aims to design and implement a standard module system for the Java SE Platform and to apply that system to the platform itself and to the JDK," according to JDK Enhancement Proposal (JEP) documentation. "Its primary goals are to make implementations of the platform more easily scalable down to small devices, improve the security and maintainability, enable improved application performance and provide developers with better tools for programming."
    Multiple JEPs are planned as part of the modularization process.

    Lightweight JSON API

    Java 9 is expected to include a lightweight JSON API to facilitate the inclusion of JSON documents and data streams in Java programming.
    "JSON has become the lingua franca for Web services and it is time for Java SE to adopt functionality for interacting with and utilizing JSON documents and data streams," a JEP document says. "This proposal is designed [to] provide the most commonly needed functionality and take advantage of Java 8/9 language and library features."
    The JSON effort aims to enable Java developers to parse and generate JSON data. A generator style API for JSON data stream output and JSON literals is also a goal.
    Process API updates

    Java 9 is also expected to improve the API for controlling and managing operating system processes.
    "The limitations of the current API often force developers to resort to native code," according to the process API JEP. Java SE presently offers limited support for native OS processes, allowing Java developers to simply set up an environment and start a process. Changes will require new unit and functional tests, according to the JEP.
    OS differences mark the main risk facing this API, in particular Windows. "The design of this API needs to accommodate possible deployment on smaller devices with different operating system models. It should also take into account environments where multiple Java virtual machines are running in the same operating system process," the JEP states.

    Segmented code cache

    Java 9 aims to divide code cache into segments to improve performance and facilitate extensions.
    "Instead of having a single code heap, the code cache is segmented into distinct code heaps, each of which contains compiled code of a particular type. Such a design enables us to separate code with different properties," the JEP states.
    Top-level types of compiled code include JVM internal code, profiled and nonprofiled code, which would be separated. The organization and maintenance of compiled code has a big impact on performance, according to the JEP. Better control of the JVM memory footprint is a goal of this initiative, as is improved execution time for some compilation-intensive benchmarks.
    Smart Java compilation, Phase 2

    Java 9 proposes to improve the sjavac compiler tool, so it can be used by default in the JDK build. The tool is also expected to be generalized for use in other large projects.
    "Due to various issues relating to stability and portability, sjavac is not used by default in the JDK build scripts," the JEP document states. "The first goal of this JEP is to resolve these issues. This involves making sure the tool produces reliable results on all software/hardware configurations at all times."
    Currently, core developers have improved sjavac's build speed and allowed for incremental builds. "The quality of the code and stability of the tool as a whole, however, is not satisfactory and it is certainly not ready for public release."
    Improve contended locking

    Core Java developers aim to boost the performance of contended Java object monitors in the next iteration of Java, as measured by benchmarks and tests, including CallTimerGrid, among others.
    "Improving contended locking will significantly benefit real-world applications, in addition to industry benchmarks such as Volano and DaCapo," JEP documentation states.
    Performance improvements will be explored in a number of areas pertaining to contended Java monitors, such as field reordering and cache line alignment, as well as fast Java monitor enter and exit operations.
    HTTP 2

    Under development by the IETF, HTTP 2 aims to improve Web page loading times and API capabilities and is based on Google's SPDY networking protocol. "The focus of the protocol is on performance; specifically, end-user perceived latency, network and server resource usage," according to HTTP 2 documentation on GitHub. "One major goal is to allow the use of a single connection from browsers to a website."
    Core Java developers are keeping an eye on HTTP 2 developments. "[This proposal is] basically looking at HTTP 2 and what is needed to support that," says Georges Saab, vice president of the Java platform group at Oracle and head of the Java Standard Edition group.



    Cloud-optimized JVM

    Core Java developers hope to enable users to better leverage existing cloud infrastructures with Java 9 by cloud-optimizing the JVM.
    This proposal is all about helping with deployments of Java in the cloud, Oracle's Saab says.
    Oracle already has been working on better enablement of cloud computing in Java EE (Enterprise Edition) 7. Plans call for building on that with Java EE 8, due in two years.
    Ahead-of-time compilation

    One common knock against Java is its relatively slower startup times. Java 9 proposes to fix this, by enabling ahead-of-time compilation to improve startup, among other benefits.
    "The primary reason for adding ahead-of-time compilation to Java is improved startup time, but it may also bring other benefits such as smaller install footprint for self-contained Java applications that are bundled with a JRE [Java Runtime Environment]," says Henrik Stahl, vice president of java product management at Oracle.

    No comments:

    Post a Comment