Java 9 features

Overview of new features and improvements in 9th version of one of the most popular programming language
09 August 2017   1000

Java 9 is going to be released on 21th of 2017, according to the developers. Let's check what are the main features of this new version.

Jigsaw Project

The primary goals of this Project are to:

  • Make the Java SE Platform, and the JDK, more easily scalable
  • down to small computing devices;
  • Improve the security and maintainability of Java SE Platform Implementations in general, and the JDK in particular;
  • Enable improved application performance; and
  • Make it easier for developers to construct and maintain libraries
  • and large applications, for both the Java SE and EE Platforms.
  • To achieve these goals we propose 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. The module system should be powerful enough to modularize the JDK and other large legacy code bases, yet still be approachable by all developers.

Learn more at OpenJDK.

JShell – The Interactive Java REPL

Java 9 will also include a new tool called "jshell", it means Java Shell and also known as REPL (Read Evaluate Print Loop). It can be used to execute and test any Java Constructs like class, interface, enum, object, statements etc. very easily without wrapping them in a separate method or project.

JShell can be launched directly from the console and you can start typing and executing Java code. One great example of jshell is to test regular expressions.

Improved Network Communication with HTTP/2.0 Support

Java 9 comes with a new way of performing HTTP based communication. It provides a long-awaited replacement of the old HttpURLConnection and supports both WebSockets and HTTP/2. The new API is located under the java.net.http package.

Enhanced Process API

Process API had a limited capability to control and manage operating system processes. Even for getting process PID, you would need to either use native code or a tricky workaround. Not to forget, you would need different implementation for each platform.

Stream API improvements

Java 9 brings significant improvements to the Stream API which packs a punch in creation of declarative pipelines of transformations on collections. Four new methods have been added to the java.util.Streaminterface – dropWhiletakeWhileofNullable. The iterate method gets a new overload, which helps in providing a Predicate on when to stop iterating.

The takeWhile method takes a predicate as an argument and returns a Stream of subset of the given Stream values until that Predicate returns false for first time. If first value does not satisfy that Predicate, it just returns an empty Stream.

Well, this is the most interesting stuff that Java 9 will include (as planned). We'll keep an eye on the most interesting news about Java 9.

Canonical to Represent Minimal Ubuntu

New version of Ubuntu is created for servers, isolated containers based on Docker and cloud systems
12 July 2018   105

Ubuntu team presented a simplified version of the base image - Minimal Ubuntu. It is designed for servers, isolated containers based on Docker and cloud systems. The release features high performance, minimal load time and automation of applications in the cloud.

The small footprint of Minimal Ubuntu, when deployed with fast VM provisioning from GCE, helps deliver drastically improved boot times, making them a great choice for developers looking to build their applications on Google Cloud Platform.
 

Paul Nash

Group Product Manager, Google Cloud

The authors of the project emphasize the size of the distribution kit, which "weighs" 157 MB, and also supports the main cloud systems like Amazon EC2, Google Compute Engine (GCE), LXD and KVM / OpenStack, each of which has its own optimized version of the package. In addition, the OS-based image for operating with containers based on the Docker platform, compatible with the Kubernetes.

Minimal Ubuntu is designed for automated execution, so it includes only a minimal set of tools. The distribution can be upgraded to a set of Ubuntu Server packages using the special utility "unminimize", which returns components that are convenient for interactive management.

According to Canonical representatives, the deletion of the manual control functions resulted in the acceleration of the load time by 40% and the reduction of the occupied disk space by 50%. At the same time, this release remained completely compatible with all the packages from standard Ubuntu repositories. Required packages can be installed using the standard package manager apt or using snapd, which are included in the distribution by default.

Two assemblies are available for download, based on Ubuntu 16.04 LTS and 18.04 LTS. You can download them on the official website.