Java 17 Features

In this section we are discussing all the feature of Java 17, Java 17 is going to the next LTS version of the Java programming language.

Java 17 Features

In this section we are discussing all the feature of Java 17, Java 17 is going to the next LTS version of the Java programming language.

Java 17 Features

Java 17 Features - Exploring the features of JDK17/Java 17

In this section we are discussing Java 17 features with many articles and example code. Java/JDK 17 will be released as long-term support (LTS) version of Java which will remain in support for many years. So, it is import for the Java programmers to learn Java 17 API and features in detail. After understanding the Java 17, developers will be able to use new features of Java in their application. There are lots of things to be offered by Java 17 to developers, let's start exploring the features of Java 17 programming language.

Java 17 will be released on 14th September 2021 and this release will obsolete Java 16. The Java 17 is coming as long-term supported (LTS) version of highly popular Java programming language.

In this section we will be posting the latest features updates till Java 17 is released in September 2021. Sun Java 17 is still not released but you may try JDK 17 Early-Access Builds to testing the new features introduced in Java 17.

Here are the summary of the features coming in Java 17:

  • JEP 356: Enhanced Pseudo-Random Number Generators
  • JEP 382: New macOS Rendering Pipeline
  • JEP 391: macOS/AArch64 Port
  • JEP 398: Deprecate the Applet API for Removal
  • JEP 410: Remove the Experimental AOT and JIT Compiler
  • JEP 409: Sealed Classes

JEPs proposed to target JDK 17 review ends

  • 414: Vector API (Second Incubator) 2021/05/18

Let's have a look at these enhancements of Java 17 one by one.

JEP 356: Enhanced Pseudo-Random Number Generators

Java 17 brings the interfaces and implementation for the generation of Enhanced Pseudo-Random Number. The Java 17 API's can be used for pseudorandom number generators (PRNGs). It also includes the generation of jumpable PRNGs. Java 17 also comes with an additional class of splittable PRNG algorithms (LXM). Java 17 provide a new interface, RandomGenerator, which is a uniform API for all existing and new PRNGs. The RandomGenerators comes with the methods named ints, longs, doubles, nextBoolean, nextInt, nextLong, nextDouble, and nextFloat. 

JEP 382: New macOS Rendering Pipeline

Apple is deprecated the OpenGL rendering library in macOS 10.14 and due to this Java 17 introduced new macOS Rendering Pipeline. Apple used Metal framework which is an replacement for the OpenGL and it is superior in performance. Java 17 will use the Metal framework for the Java 2D rendering API.

The macOS Rendering Pipeline is fully functional rendering pipeline for the Java 2D API, which uses macOS Metal framework internally. The new rendering pipeline will provide superior performance on the macOS devices.

JEP 391: macOS/AArch64 Port

Apple is moving their hardware architecture from  x64 to AArch64 and shared their long-term transition plan. To enable the Java to take full advantage of  AArch64, Java 17 is being ported to the AArch64 architecture. There will huge board demand of Java for macOS/AArch64. The meet this industry demand Java 17 will is being ported to the macOS/AArch64 architecure.

JEP 398: Deprecate the Applet API for Removal

The Applet API was previously deprecated in Java 9 by JEP 289. Now in Java 17 deprecate Applet API will be removal. So, in Java 17 Applet will be removed. It is to be noted that many web-browser vendors have already removed support of Applet or they are remove it soon.

JEP 410: Remove the Experimental AOT and JIT Compiler

In Java 17 experimental Java-based ahead-of-time (AOT) and just-in-time (JIT) compiler will be removed. The use of this compiler has seen little use since its introduction, while the maintenance cost is significant, so it is decided to remove in Java 17.

Java 17 retain the experimental Java-level JVM compiler interface (JVMCI), that will allow the developers to continue to use externally-built versions of the compiler for JIT compilation.

Remove three JDK modules:

  • jdk.aot - the jaotc tool
  • jdk.internal.vm.compiler - the Graal compiler
  • jdk.internal.vm.compiler.management - Graal's MBean

Preserve these two Graal-related source files so that the JVMCI module (jdk.internal.vm.ci, JEP 243) continues to build:

  • src/jdk.internal.vm.compiler/share/classes/module-info.java
  • src/jdk.internal.vm.compiler.management/share/classes/module-info.java

Remove HotSpot code related to AOT compilation:

  • src/hotspot/share/aot ? dumps and loads AOT code
    Additional code guarded by #if INCLUDE_AOT

Finally, remove tests as well as code in makefiles related to Graal and AOT compilation.

JEP 409: Sealed Classes

The sealed classes are coming to Java 17 programming language which will enable to develop the sealed classes and interfaces in Java. The sealed classes and interfaces actually restricts and allows the developers to specify which other classes or interfaces may extend or implement them.  This is another very good feature coming to the Java 17 version of Java language.

JEP 414: Vector API

Java 17 will come with the Incubator Vector API which will allow the developers to run vector instruction on the CPU architecture. The Vector API is for vector computations that can be used for vector instructions reliably on the supported CPU architectures. This will will a superior performance as compared to the equivalent scalar computations.

Java 17 Tutorials: