What's Coming with Java 9

Java 9 is inching toward its general availability (23 March, 2017). JDK committers are hard at work to deliver because the countdown has begun. Java Enhancement Proposals (JEP) has published a long list of features as its improvement proposals. It includes many major/minor improvements in the form of new capabilities, syntactical changes, performance tweaks, and the much anticipated modularity. These improvements will soon bring about some noticeable changes in the way we program in Java. This article picks up ten key areas from the JEP index that are going to influence Java programmers in the years to come.

1. Flagship Feature: Project Jigsaw

If lambda is a flagship feature of Java 8, modularity is the flagship feature of Java 9. Modularity is the result of the heavy influence of Project Jigsaw. It is actually a deferred feature that was supposed to be included from Java 8, but got a go-ahead with Java 9. It is expected to change the paradigm of Java coding in maintaining dependency issues popularly called jar hell, something that rhymes with DLL hell. Although Maven has provided a certain respite, Project Jigsaw is anticipated to be the core response to the much needed capability of Java. Maintaining a transitive dependency in an application is and always has been a pain in the neck. Java 9 will better understand the dependency across modules and resolve them at compile time or run time. According to JEP, the primary goal of this feature is to:

Enhance scalability of the Java SE platform and JDK down to small computing devices

Improve security and maintainability

Provide easy construction and maintenance of libraries

The enhancement will have an overall impact on both the Java SE and Java EE platforms.

Another major improvement can be seen with the APIs dealing with controlling and arranging operating system processes. Until Java 8, this had been a neglected area and Java API support was quite limited. Programmers had to resort to native codes to handle many of the core features of the underlying operating system. The new APIs will provide considerable support in this area.

The API dealing with images in the java.awt.image package is also revamped. The API enhancement will enable a set of images to be encapsulated into a single multi-resolution image. The variance of resolution can be retrieved based upon DPI metrics and a set of image transformation APIs.

Java 8 does not have any efficient APIs to traverse selected frames on the execution stack and to access the Class instance of each frame. The new stack-walking APIs will enable us to filter and lazy load the information in stack traces.

Java 9 enhanced the logging infrastructure used by the JDK classes with the help of new Service Loader APIs. Until now (Java 8), JDK classes use their own logging infrastructure. With Java 9, we'll have a choice to use the default logging implementation based upon the java.util.logging or route platform log messages to the logging framework such as SLF4J or Log4J.

There are many minor tweaks introduced with Java 9 language syntaxes, apart from improving the capabilities of interfaces. A Java 9 interface can declare private methods, keeping intact the feature of the default method introduced by Java 8. The try-with-resource statement syntax has been improved. The syntaxes with anonymous class now can infer their designated type. Other improvements included in the area such as annotation @SafeVarargs, deprecated syntaxes, and so forth.

Concurrency updates are minimal and are supposed to be a response in support of the Reactive System public-subscribe network. A handful of interfaces is provided, which can help developers build custom components to support interoperability across various async systems running in JVMs.

Java 9 made important changes in the process of creating an ad-hoc collection with the help of the static factory method. This will work on the Collection interface to create an unmodifiable collection instance. Java 8 and its predecessors had been quite verbose even in creating a simple list, as follows:

Java 9 introduces an API to support the manipulation of platform-specific desktop features. Targeted platforms are Windows, Linux, and Mac OS X. The public APIs will enable programmers to interact with the taskbar or dock, or listening for systems or application events.

There has been criticism on the object serialization mechanism conventionally implemented by the core JVM framework. Data transmission is a serialization task and may be compromised, which in turn may make the JVM itself vulnerable. Java 9 seems to take on the issue and provides a sort of filtering mechanism on incoming streams to improve the security and robustness of the existing system of the serialization and deserialization processes.

Conclusion

Apart from these ten, there are many other tweaks and enhancements to be served once the feature complete Java 9 is released. Other improvements areas are in the arena of low-level APIs, networking, XML, Nashorn parsing APIs, existing API extensions, jshell, and so on. Many old APIs have been removed from the core library. Moreover, the JDK 9 file structure also has been revamped. Java 8 and its prior version users will find something new right from the installation directory. However, nothing appeases us until we see the final release. Until then, we wait for the final countdown.

IT Solutions Builder
TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD

Which topic are you interested in?

Mobile

Security

Networks/IoT

Cloud

Data Storage

Applications

Development

IT Management

Other

What is your company size?

What is your job title?

What is your job function?

Searching our resource database to find your matches...

Please enable Javascript in your browser, before you post the comment! Now Javascript is disabled.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.

Thanks for your registration, follow us on our social networks to keep up-to-date