Java 8 Vs. Java 9: Get Ready for a New Era
Tags: java9
Published: 2019-07-24 15:43:54

<span style="font-weight: 400;">The average business owner just wants his software or apps to work stable. He either has in-house developers, or he outsources. Either way, he determines what he wants a new software to do, conveys that to his developers, and expects them to come through. What he has a right to expect is a custom solution, designed specifically for his company, that, with some training and support, will meet his expectations for performance. </span>

<span style="font-weight: 400;">More often than not, this means that developers turn to Java, a programming language with amazing versatility. Today, there are </span><a href="https://www.thoughtco.com/what-is-java-2034117"><span style="font-weight: 400;">more than 6.5 million Java developers globally</span></a><span style="font-weight: 400;">, because of its utility, ease of use, security, reliability, and the platform independence (it works no matter what the hardware or the operating system is in use).</span>
<h2><span style="font-weight: 400;">Why Java and Java 9?</span></h2>
<img class="img-responsive" src="https://www.romexsoft.com/wp-content/uploads/2017/04/882x200-12.jpg" alt="why Java" />

<span style="font-weight: 400;">Java was developed by Sun Microsystems in 1995, originally designed for interactive television. When Java 1.0 was released publicly, however, it had shifted focus to Internet use. And it became one of the most popular programming languages for all of the elements listed above.</span>

<span style="font-weight: 400;">Obviously, there have been many updates since 1.0. The latest version is Java 8, in the process of being replaced by Java 9. Oracle announced the </span><a href="http://www.networkworld.com/article/2920183/microsoft-subnet/mark-your-calendar-java-9-finally-has-a-release-date.html"><span style="font-weight: 400;">Java 9 release date</span> <span style="font-weight: 400;">of September 22, 2016</span></a><span style="font-weight: 400;">, with a rolling out of new features and elements over the next 16 months. That date has been moved to March and now to July, 2017 for a number of reasons, but primarily because the developers want to take extra time to ensure that bugs and issues are fixed before the release – something that was not done with the release of Java 8.</span>

<span style="font-weight: 400;">Java 9 has been a long time coming, and here’s why. When Oracle bought Sun Microsystems in 2010, Java was kind of on hold during the long purchasing process. It lost a lot of talent. Oracle had to rebuild a Java development team, which then began the process of revising and the long-desired modularization.</span>

<span style="font-weight: 400;">There are lots of features of Java 9 that have developers pretty excited. And these new features will have important implications for businesses that want fast, efficient and robust custom software solutions.</span>
<h3><span style="font-weight: 400;">New Features of Java 9: Quick Summary</span></h3>
<span style="font-weight: 400;">While much of this may not mean a great deal to a business owner, the new features of Java 9 have lots of meaning for developers, as they look at what’s new. Here is an overview of four of the most important.</span>
<ol>
 	<li style="font-weight: 400;"><a href="http://openjdk.java.net/jeps/222"><b>Jshell</b></a><span style="font-weight: 400;">: This is a new command line tool. It means that if a developer wants to run just a few lines of Java as a standalone, it can be done without having to wrap it all in a separate method or project.</span></li>
 	<li style="font-weight: 400;"><a href="http://openjdk.java.net/jeps/230"><b>Microbenchmarks</b></a><b>:</b><span style="font-weight: 400;"> Now, the performance of very specific and small pieces of code can be measured with a standardized method. The Java harness (JMH) for analyzing down to nanoseconds is unique to Java 9.</span></li>
 	<li style="font-weight: 400;"><a href="http://openjdk.java.net/jeps/110"><b>Full Support for HTTP 2.0 Client</b></a><span style="font-weight: 400;">: This is a speed thing, and HTTP 2.0 Client has shown to provide greater speed, </span><a href="http://blog.takipi.com/5-features-in-java-9-that-will-change-how-you-develop-software-and-2-that-wont/"><span style="font-weight: 400;">ranging from 11.81% to 47.7% over HTTP 1.1 Client</span></a><span style="font-weight: 400;">.</span></li>
 	<li style="font-weight: 400;"><a href="http://openjdk.java.net/jeps/102"><b>Process API</b></a><span style="font-weight: 400;">: An API (application programming interface) allows app’s processes communicate with each other without using native code. This update in Java 9 will extend the ability of Java in controlling and managing OS processes.</span></li>
 	<li style="font-weight: 400;"><a href="http://openjdk.java.net/jeps/201"><b>Modular Source Code</b></a><span style="font-weight: 400;">: Organizes JDK source code into modules.</span></li>
</ol>
That sounds promising, isn't it?
<blockquote style="font-size: 14px; background-color: #f4f4f4;"><em><span style="font-weight: 400;">From rational perspective the most awaited feature for me is the new HTTP Client that supports both HTTP/2 protocol and WebSocket. And here’s why:</span></em>
<ol>
 	<li style="font-weight: 400;"><em><span style="font-weight: 400;">Non blocking mode support (many threads per request/response). </span></em></li>
 	<li style="font-weight: 400;"><em><span style="font-weight: 400;">Enhanced performance </span><span style="font-weight: 400;">(by 4</span><span style="font-weight: 400;">5% in comparison to HTTP/1.1) that</span><span style="font-weight: 400;"> will be on par with Netty or Jetty.</span></em></li>
 	<li style="font-weight: 400;"><em><span style="font-weight: 400;">Server push support which will make possible to push resources to the client without an explicit request.</span></em></li>
</ol>
<em><span style="font-weight: 400;">The second feature (less important though the cute one) I’m looking forward to is the Streaming API improvement, especially the dropWhile and takeWhile methods that will be very use</span><span style="font-weight: 400;">ful in functional programming.</span></em>
<p style="text-align: right;">-- Ivan, Senior Java Developer at Romexsoft</p>
</blockquote>
<h3><span style="font-weight: 400;">Comparison of Java 8 and Java 9</span></h3>
<span style="font-weight: 400;">Java 8 features have given developers remarkable versatility and the ability to provide software solutions to a wide variety of business sectors, including </span><a href="https://www.romexsoft.com/fintech/"><span style="font-weight: 400;">fintech</span></a><span style="font-weight: 400;">, </span><a href="https://www.romexsoft.com/healthcare-app-development/"><span style="font-weight: 400;">healthcare</span></a><span style="font-weight: 400;">, and other industries.</span>
<a href="https://www.romexsoft.com/contact-us/" target="_blank" rel="noopener noreferrer"> <img style="float: right; border-width: 0px; border-style: solid; margin: 10px;" src="https://www.romexsoft.com/wp-content/uploads/2018/01/Request-a-Code-Review_Romexsoft.png" width="350" height="350" /></a>
<span style="font-weight: 400;">The coming of Java 9, however, promises to deliver even more versatility and the ability to customize even further. For businesses, this is a huge plus. </span>

<span style="font-weight: 400;">Here, in rather simplistic terms, are just some new features of Java 9 that Java 8 did not have.</span>

<a href="http://openjdk.java.net/projects/jigsaw/"><b>The Reason for the Title “Jigsaw”</b></a>

<span style="font-weight: 400;">Project Jigsaw is the modularization of Java. Basically, it means that programming code is broken up and organized into modules based upon the tasks that those modules execute. By doing this, modules are reusable and far easier to manage and debug. This means that software development becomes easier, more streamlined, and debugged faster. This is a key difference between Java 8 and Java 9.</span>

<span style="font-weight: 400;">The second big benefit - it makes the Java Platform more lightweight and more scalable. It allows Java applications to run even on devices with low productivity (requires less resource to work).</span>
<blockquote style="font-size: 14px; background-color: #f4f4f4;"><em>The latest Java 8 release brought a variety of new features that significantly changed developer's life. But what's more, Oracle prepares to release Java 9 with a bunch of new groundbreaking ones.</em>

<em>For me, the most anticipated feature of Java 9 is Jigsaw project which introduces a new module system that breaks the JRE into interoperable components.</em>

<em>With a modular JRE, applications will be enabled to run on even embedded systems. This is an especially huge change in the context of the advent of Internet of Things (IoT). It carries forward Java and it means we have a chance to have a big number of IoT apps written in Java.</em>
<p style="text-align: right;">-- Yura, Senior Full Stack Java Developer at Romexsoft</p>
</blockquote>
<a href="http://openjdk.java.net/jeps/222"><b>The Jshell Command Line Tool</b></a>

<span style="font-weight: 400;">As mentioned above, this is an interactive tool that will allow testing of small snippets of code rather than requiring the creation of a new class. This new shell also comes with history and auto-completion features as well as other functionalities, like saving and loading some or all written statements.</span>

<a href="http://openjdk.java.net/jeps/251"><b>Multi-Resolution Image</b></a>

<span style="font-weight: 400;">This API will allow the encapsulation of a set of images that all have different resolutions into a single object. Thus, a developer can retrieve an image that is resolution-specific or retrieve all variants within the image.</span>

<a href="http://openjdk.java.net/jeps/158"><b>Unified JVM Logging</b></a>

<span style="font-weight: 400;">Now there is a common logging system for all JVM components. However, if we look at pros and cons of Java 9, here is one. It doesn’t add logging calls from all JVM components and doesn’t add logging to Java code in the Java Development Kit.</span>

<a href="http://openjdk.java.net/jeps/266"><b>Publish-Subscribe Framework</b></a>

<span style="font-weight: 400;">This is an improvement over Java 8, as these interfaces will better support the interoperability of a number of asynchronous systems that run on JVM’s (Java Virtual Machines). The idea behind JVM’s is that they allow any computer to run a Java program, by converting Java code into machine language and then executing it. Improvements in this area are one of the big advantages of Java 9.</span>

<b>Immutable List, Set, Map, and Map.Entry API</b>

<span style="font-weight: 400;">In Java 8, to create a collection of several elements, a developer had to create several lines of code. Now it can be accomplished in a single line of code. One of the time-consuming disadvantages of Java 8 has thus been eliminated.</span>
<blockquote style="font-size: 14px; background-color: #f4f4f4;"><em>I’m expecting the Stream API Improvements. Why? It will facilitate the work with arrays and accelerate various functions.</em>

<em>As an example, check this:</em>

<em>Stream.of(1,2,3,4,5,6,7,8,9,10).takeWhile(i -&gt; i &lt; 5 ).forEach(System.out::println);</em>

<em>Will deliver: 1 2 3 4</em>

<em>Looks promising, isn't it?</em>
<p style="text-align: right;">-- Mykhaylo, Team Lead at Romexsoft</p>
</blockquote>
<h3><span style="font-weight: 400;">Benefits of Java 9 For Businesses</span></h3>
<span style="font-weight: 400;">Granted, the details of Java 8 vs. Java 9 may not be of huge interest to the business looking for the best software solutions to meet its needs. To the developer, however, there will be a significant difference between Java 8 vs. Java 9 performance in creating those software solutions. </span>

<span style="font-weight: 400;">Whether using Java SE 9 or any other version, dependent upon the business need, the inclusion of the latest features will bring about improvements in the following:</span>
<ul>
 	<li style="font-weight: 400;"><span style="font-weight: 400;">Greater speed of development, specifically due to the system of modules which are reusable and much easier to debug and to manage.</span></li>
 	<li style="font-weight: 400;"><span style="font-weight: 400;">One more benefit of the system of modules is that it will improve the resource effectiveness of applications (small or big ones) as for their development programmers will need to take only needed modules instead of all JRE.</span></li>
 	<li style="font-weight: 400;"><span style="font-weight: 400;">Creation of sets using a single rather than several lines of code.</span></li>
 	<li style="font-weight: 400;"><span style="font-weight: 400;">Microbenchmarks that will allow performance analysis of very small pieces of code.</span></li>
 	<li style="font-weight: 400;"><span style="font-weight: 400;">Support for HTTP 2.0 Client – greater speed.</span></li>
</ul>
<span style="font-weight: 400;">And this is just a partial list. But all of these and the other new features make the developer’s job of designing the roadmap for a custom business solution and then creating the software based upon that roadmap more streamlined. That streamlining of developing, testing and debugging means that the final product will have far fewer issues that need to be addressed. In this type of development environment, everyone wins.</span>

<span style="font-weight: 400;">If you are looking for expertise in software solution development, we invite you to contact Romexsoft, present your need, and allow us to provide you with an overview of how we can meet that need through our current Java 8 expertise and the use of Java 9 features that are soon rolling out. We are ready and embracing this new era of Java!</span>
<span style="color: #ffffff;"><em>Author: Yura Bondarenko</em></span>
Originally published at Romexsoft Blog <a href="https://www.romexsoft.com/blog/java-8-vs-java-9/">“Java 8 Vs. Java 9: Get Ready for a New Era”</a>