Posts

Showing posts with the label java 16

Java Packaging Tool

Packaging Tool feature added in jdk version 16. The jpackage tool was introduced as an incubating tool in JDK 14.  It is now ready to be promoted from incubation to a production-ready feature. As a consequence of this transition, the name of the jpackage module will change from jdk.incubator.jpackage to jdk.jpackage. Goals Create a packaging tool, based on the legacy JavaFX javapackager tool, that: Supports native packaging formats to give end users a natural installation experience. These formats include msi and exe on Windows, pkg and dmg on macOS, and deb and rpm on Linux. Allows launch-time parameters to be specified at packaging time. Can be invoked directly, from the command line, or programmatically, via the ToolProvider API. Description The jpackage tool packages a Java application into a platform-specific package that includes all of the necessary dependencies. The application may be provided as a collection of ordinary JAR files or as a collection of modules. The supporte...

Java 16 : Vector API (Incubator) example

jdk.incubator.vector express vector computations that reliably compile at runtime to optimal vector hardware instructions on supported CPU architectures and thus achieve superior performance to equivalent scalar computations. Goal of Vector api: Clear and concise API Platform agnostic Reliable runtime compilation and performance on x64 and AArch64 architectures  Graceful degradation Vector computations consist of a sequence of operations on vectors. A vector comprises a (usually) fixed sequence of scalar values, where the scalar values correspond to the number of hardware-defined vector lanes. A binary operation applied to two vectors with the same number of lanes would, for each lane, apply the equivalent scalar operation on the corresponding two scalar values from each vector. This is commonly referred to as Single Instruction Multiple Data (SIMD). Example Here is a simple scalar computation over elements of arrays: void scalarComputation(float[] a, float[] b, float[] c) {  ...

Java - JEP 347: Enable C++14 Language Features

This features added in JDK 16. This includes being able to build with recent versions of various compilers that support C++11/14 language features. Summary: Allow the use of C++14 language features in JDK C++ source code, and give specific guidance about which of those features may be used in HotSpot code. The purpose of this JEP is to formally allow C++ source code changes within the JDK to take advantage of C++14 language features. Lists of new features for C++11 and C++14, along with links to their descriptions, can be found in the online documentation for some of the compilers and libraries: C++ Standards Support in GCC C++ Support in Clang Visual C++ Language Conformance libstdc++ Status libc++ Status

Java - APIs for Creating Unmodifiable Collections

Several new APIs have been added that facilitate the creation of unmodifiable collections. The List.copyOf Set.copyOf Map.copyOf  methods create new collection instances from existing instances. New methods have been added to the Collectors class in the Stream package. toUnmodifiableList toUnmodifiableSet toUnmodifiableMap   These allow the elements of a Stream to be collected into an unmodifiable collection.

Lambda expressions - implicitly typed parameters

For formal parameters of implicitly typed lambda expressions, allow the reserved type name `var` to be used, so that:     (var x, var y) -> x.process(y) is equivalent to:     (x, y) -> x.process(y) An implicitly typed lambda expression must use `var` for all its formal parameters or for none of them. In addition, `var` is permitted only for the formal parameters of implicitly typed lambda expressions --- explicitly typed lambda expressions continue to specify manifest types for _all_ their formal parameters, so it is not permitted for some formal parameters to have manifest types while others use `var`. The following examples are illegal:     (var x, y) -> x.process(y)         // Cannot mix 'var' and 'no var' in implicitly typed lambda expression     (var x, int y) -> x.process(y)     // Cannot mix 'var' and manifest types in explicitly typed lambda expression In theory, it would be...

Java 16 Features | What's new in Java 16?

Java 16 Features JDK 16 is the open-source reference implementation of version 16 of the Java SE Platform as specified by JSR in the Java Community Process.  After jdk 15 released oracle is working on JDK16 and JDK17.  Some of the important Java 16 features are: Java 16 Features: JEPs targeted to JDK 16, so far 357: Migrate from Mercurial to Git 369: Migrate to GitHub 347: Enable C++14 Language Features 338: Vector API (Incubator) 387: Elastic Metaspace 386: Alpine Linux Port 376: ZGC: Concurrent Thread-Stack Processing 386: Alpine Linux Port 388: Windows/AArch64 Port Some More java 16 features are coming up. We will discuss once openjdk Java Community Process released some information. This release will be the Reference Implementation of version 16 of the Java SE Platform, as specified by JSR 391 in the Java Community Process. What's new in Java 16? 357: Migrate from Mercurial to Git Migrate all single-repository OpenJDK Projects from Mercur...