Social Media
Photo by Tom Mussak on Unsplash

My Top Java 9 Features

I was busy last week and didnt have time to write a post on Java9, so have decided to do one now. The big story with Java 9 is the Jigsaw Java Platform Modularity System(JPMS) platform. It delayed the release of Java9, but this was a good thing as a poor implementation of Jigsaw would set Java back in the long run.

Java 9 is now released and this post takes a look at my top Java 9 features

New Features

A full list of Java 9 features can be found here, but the features I am most interested in are –

  • Java Platform Modularity System(JPMS) – Prior to Java 9 you could pretty much access any public class on your classpath. This made it difficult to truly encapsulate API’s. Java 9’s JPMS seeks to resolve this through a module descriptor – module-info.java – which defines a modules requirements and what it exports
  • JShell – REPL(Read-Eval-Print-Loop), or Shells, have been a common feature of other languages for a while, and Java has finally introduced a Java Shells. This provides a great environment for experimenting with API’s
  • HTTP/2 Client – This client provides HTTP 2.0 support in the Java platform, and will replace the existing HttpURLConnection API. The key benefit of this is will result in improved performance over the HTTP1.1 implementation
  • Streams API – There are some updates to the Streams API, including takeWhile, dropWhile which take/drop elements while a condition remains true
  • Process API – The process API changes allows Java to manage OS processes without resorting to parsing the output of a call to System.exec. The simplest example is accessing the process Id, where we can now call –
  • Private Methods In Interfaces – Java8 introduced default and static methods in interfaces allowing us to add behaviour to interfaces. Private methods build on this by allowing default methods to call private methods implementing shared behaviour.

Download

You can download Java 9 at – download

About the Author Martin Farrell

My name is Martin Farrell. I have almost 20 years Java experience. I specialize inthe Spring Framework and JEE. I’ve consulted to a range of businesses, and have provide Java and Spring mentoring and training.

You can learn more at About

follow me on:

Leave a Comment:

4 comments
JShell in Five Minutes - javabullets says 01/10/2017

[…] How Lambda’s And Anonymous Inner Classes(AIC) Work JShell in Five Minutes My Top Java 9 Features Add EntityManager.refresh to all Spring Data Repositories When a blank isnt blank […]

Reply
Experimenting with Java9 HTTP Client and Process API in JShell - javabullets says 10/10/2017

[…] with Java9 HTTP Client and Process API in JShell JShell in Five Minutes My Top Java 9 Features Add EntityManager.refresh to all Spring Data Repositories When a blank isnt […]

Reply
Java9 JShell Examples : Collections Static Factory Methods - javabullets says 23/10/2017

[…] with Java9 HTTP Client and Process API in JShell JShell in Five Minutes My Top Java 9 Features Add EntityManager.refresh to all Spring Data […]

Reply
Java 9 Streams API using JShell - javabullets says 05/11/2017

[…] My Top Java 9 Features JPA Entity Lifecycle Why do we still create Util classes? Introduction to Spring Data REST Access the EntityManager from Spring Data JPA Java 9 Streams API using JShell Java9 JShell Examples : Collections Static Factory Methods Experimenting with Java9 HTTP Client and Process API in JShell JShell in Five Minutes My Top Java 9 Features […]

Reply
Add Your Reply