Latest Java 19 : JDK 19 Arrived- What's new features in Java 19
The latest version of Java 19 (JDK 19) has released on Sep 20, 2022, featuring 7 new platform upgrades that would help developers work more efficiently.
It including Structured Concurrency, Virtual Threads, Port the JDK to Linux/RISC-V (2 incubator and 4 preview feature, 1 final feature under Hotspot Compiler)
Java 19 release date :
20 September 2022Java 19 Download :
Java 19 JDKJava 19 has below features coming out as part of the JDK 19:
-
JEP 428: Structured Concurrency (Incubator)
-
JEP 427: Pattern Matching for switch (Third Preview)
-
JEP 426: Vector API (Fourth Incubator)
-
JEP 425: Virtual Threads (Preview)
-
JEP 424: Foreign Function & Memory API (Preview)
-
JEP 422: Linux/RISC-V Port
-
JEP 405:Record Patterns (Preview)
JEP 428: Structured Concurrency (Incubator)
Introduce an API for structured concurrency to simplify multithreaded programming. Structured concurrency treats multiple tasks running in different threads as a single unit of work, streamlining error handling and cancellation while also improving reliability and observability.
Goals
-
Enhance the multithreaded code's capacity to be maintained, reliable, and observable.
-
Encourage the use of concurrent programming techniques that can reduce typical cancellation and shutdown hazards including thread leaks and cancellation delays.
Non-Goals
-
None of the concurrency constructs in the java.util.concurrent package, such as ExecutorService and Future, are intended to be replaced.
-
Definition of the final Java structured concurrency API is not a goal. Future JDK releases or other third-party libraries may specify more formal concurrency constructs.
-
Define a method for data sharing between threads is not a goal (i.e., channels). Future proposals might include doing so.
JEP 427: Pattern Matching for switch (Third Preview)
The Java programming language now supports pattern matching for switch expressions and statements. By expanding pattern matching to switch, which enables an expression to be checked against a range of patterns, each with a defined action, complex data-oriented queries can be constructed succinctly and safely.
Goals
-
Switch expressions and statements can be made more expressive and useful by allowing patterns to appear in case labels.
-
Allow the switch to drop its previous null-hostility whenever required.
-
You may make switch statements more secure by requiring that pattern switch statements cover all possible input values.
-
Verify that all currently employed switch expressions and statements execute and compile with the exact same semantics.
JEP 426: Vector API (Fourth Incubator)
The newly developed Vector API for mathematical vector computing. An API for expressing vector computations that consistently compile at runtime to the best possible vector instructions on the supported CPU architectures, resulting in performance that is better than that of equivalent scalar computations. We will see more details once it's in preview state
JEP 425: Virtual Threads (Preview)
One of the most significant breakthroughs in Java for a very long time has been virtual threads. They were created as part of Project Loom, and since Java 19, they have been available as a preview feature in the JDK.
Virtual threads enable us to write readable and maintainable code that does not block operating system threads while waiting for locks, blocking data structures, or responses from the file system or external services.
Virtual threads behave like conventional threads in Java code, but they are not mapped 1:1 to operating system threads. When a virtual thread hits a blocking action, then execute another virtual thread. Thus, blocking actions no longer obstruct the running thread. This allows us to process a high number of requests in parallel with a small pool of carrier threads.
JEP 424: Foreign Function & Memory API (Preview)
Java programmers are faced challenges with a choices when it comes to accessing off-heap data: Should they go the safe but ineffective way (ByteBuffer) or should they forgo safety in favour of performance (Unsafe)?
Java 19 has introduced an API that allows Java programmes to interact with code and data that is not part of the Java runtime. The API enables Java programmes to call native libraries and handle native data without the brittleness and danger of JNI by effectively executing foreign functions (i.e., code outside the JVM) and safely accessing foreign memory (i.e., memory not maintained by the JVM).
-
Ease of use - Use a superior, pure-Java programming approach instead of the Java Native Interface (JNI).
-
Performance - Offer performance that is on par with, if not superior to, that of currently available APIs like JNI and sun.misc.Unsafe.
-
Generality - Provide methods for operating on various types of foreign memory (e.g., native memory, persistent memory, and managed heap memory) as well as, in time, other platforms (e.g., 32-bit x86) and foreign functions written in languages other than C (e.g., C++, Fortran).
-
Safety - Permit programmes to execute risky operations on external memory, but by default, alert users about these activities.
JEP 422: Linux/RISC-V Port
Port the JDK to Linux/RISC-V.
RISC-V is a free and open-source RISC instruction set architecture (ISA) that was developed collaboratively under the sponsorship of RISC-V International. It was originally designed at the University of California, Berkeley, and is now developed collaboratively under the sponsorship of RISC-V International.
A wide range of language toolchains already support it. A port of the JDK might be useful as RISC-V hardware becomes more widely available.
JEP 405:Record Patterns (Preview)
In JDK 16, JEP 394 added pattern matching to the instanceof operator. This minor addition simplifies the well-known instanceof-and-cast idiom.
JDK 19 extends record patterns to the Java programming language to decompose record values. Nesting record patterns and type patterns allows for a powerful, declarative, and composable method of data navigation and processing.
-
Increase the expressiveness of pattern matching to define more complex, composable data queries.
-
Do not alter the semantics or syntax of type patterns.
Java 18 has below features coming out as part of the JDK 18:
-
JEP 400: UTF-8 by Default
-
JEP 408: Simple Web Server
-
JEP 413: Code Snippets in Java API Documentation
-
JEP 416: Reimplement Core Reflection with Method Handles
-
JEP 417: Vector API (Third Incubator)
-
JEP 418: Internet-Address Resolution SPI
-
JEP 419: Foreign Function & Memory API (Second Incubator)
-
JEP 420: Pattern Matching for switch (Second Preview)
-
JEP 421: Deprecate Finalization for Removal
JEP 408 : UTF-8 by Default
Set UTF-8 as the default charset for Java APIs. Except for terminal I/O, use UTF-8 across the regular Java APIs. As a result of this change, APIs that rely on the default charset will now behave consistently across all implementations, operating systems, locales, and configurations.
The default charset is determined when the Java runtime starts in JDK 17 and before. By making UTF-8 the default charset, there's a chance that programmes won't work properly with data produced when the new default charset isn't specified.Though risk is not new.
Developers are strongly encouraged to check for charset issues by starting the Java runtime with -Dfile.encoding=UTF-8 on their current JDK release (JDK 8-17).
On macOS and many linux distributions use UTF-8 as its default charset for several releases except when configured to use the Posix C locale, the proposal states. While On other operating systems, like Windows users in Asian and other locales upon the user's locale and the default encoding (windows-1252 or windows-31j) there may be significant risk.
JEP 400 : Simple Web Server
Provide an out-of-the-box static HTTP file server with limited functionality and quick setup. There is no CGI or servlet-like capabilities.
Provide a command-line default implementation as well as a tiny API for programmatic creation and customization.
We can use $ jwebserver command to starts the Simple Web Server, which allow few configuration through parameters like -b, -p, -d, -h etc
This tool will be particularly useful in educational contexts for prototyping, ad-hoc coding, and testing only not intended for commercial-grade server.
JEP 413: Code Snippets in Java API Documentation
With addition of a @snippet tag to JavaDoc's Standard Doclet to declare code fragments to appear in the generated documentation, insertion of example source code in API documentation become easier. Also improve IDE support for snippet creation and editing.
By giving API access to source code fragments, you may make it easier to validate them. Although the author is ultimately responsible for correctness, improved javadoc and related tools can make it easier to achieve.
Enable modern styling features like syntax highlighting and automated name-to-declaration linking.
JEP 416: Reimplement Core Reflection with Method Handles
With addition of a @snippet tag to JavaDoc's Standard Doclet, insertion of example source code in API documentation become easier. Also improve IDE support for snippet creation and editing.
By giving API access to source code fragments, you may make it easier to validate them. Although the author is ultimately responsible for correctness, improved javadoc and related tools can make it easier to achieve.
Enable modern styling features like syntax highlighting and automated name-to-declaration linking.
Java 17 has released on 14 September 2022, you can checkout its features below :
Checkout Java 17 / JDK 17 Features :
-
JEP 415: Context-Specific Deserialization Filters
-
JEP 414: Vector API (Second Incubator)
-
JEP 412: Foreign Function & Memory API (Incubator)
-
JEP 411: Deprecate the Security Manager for Removal
-
JEP 410: Remove the Experimental AOT and JIT Compiler
-
JEP 409: Sealed Classes
-
JEP 407: Remove RMI Activation
-
JEP 406: Pattern Matching for switch (Preview)
-
JEP 403: Strongly Encapsulate JDK Internals
-
JEP 398: Deprecate the Applet API for Removal
-
JEP 391: macOS/AArch64 Port
-
JEP 382: New macOS Rendering Pipeline
-
JEP 356: Enhanced Pseudo-Random Number Generators
-
JEP 306: Restore Always-Strict Floating-Point Semantics
Java 16 : JDK 16 Features
Java 17 is still in progress, so you can take a look at the latest Java version: Java 16 functionality upgrade to get an idea of what will be in JDK 17
The open-source Java 16 (Java SE 16) and Java Development Kit 16 (JDK 16) is released. The feature set has been frozen for the time being. There will be no more JEPs for this release; developers can start looking at JDK 16 now to get a sense of what's coming in JDK 16. Java 16 released on date : 16 March 2021
Some of the new feature highlights of JDK 16 includes concurrent thread-stack processing for garbage collection, support for C++ 14 language features, an "elastic metaspace" capability to more quickly return unused class metadata memory to the OS, procedural upgrades, new APIs and tooling, operating system ports, strongly encapsulating JDK internals by default, and many more..
Download : JDK 16 ReleaseJDK 16 is here, below features are part of jdk 16.
-
JEP 397: Sealed Classes (Second Preview)
-
JEP 396: Strongly Encapsulate JDK Internals by Default
-
JEP 395: Records
-
JEP 394: Pattern Matching for instanceof
-
JEP 393: Foreign-Memory Access API (Third Incubator)
-
JEP 392: Packaging Tool
-
JEP 390: Warnings for Value-Based Classes
-
JEP 389: Foreign Linker API (Incubator)
-
JEP 388: Windows/AArch64 Port
-
JEP 387: Elastic Metaspace
-
386: Alpine Linux Port
-
JEP 376: ZGC: Concurrent Thread-Stack Processing
-
JEP 369: Migrate to GitHub
-
JEP 357: Migrate from Mercurial to Git
-
JEP 347: Enable C++14 Language Features
-
JEP 338: Vector API (Incubator)
Take a look at our Suggested Posts :
Quick glance on earlier Java Versions Features :
Java 15 Features - JDK 15
JDK Enhancement Proposals (JEP) has now been officially released on 15 September 2020, listed below features/enhancements as part of the jdk 15 :
-
JEP 339: Edwards-Curve Digital Signature Algorithm (EdDSA)
-
JEP 360: Sealed Classes (Preview)
-
JEP 371: Hidden Classes
-
JEP 372: Remove the Nashorn JavaScript Engine
-
JEP 374: Disable and Deprecate Biased Locking
-
JEP 375: Pattern Matching for instanceof (Second Preview)
-
JEP 377: ZGC: A Scalable Low-Latency Garbage Collector
-
JEP 378: Text Blocks
-
JEP 379: Shenandoah: A Low-Pause-Time Garbage Collector
-
JEP 381: Remove the Solaris and SPARC Ports
-
JEP 383: Foreign-Memory Access API (Second Incubator)
-
JEP 384: Records (Second Preview)
-
JEP 385: Deprecate RMI Activation for Removal
Java 14 Features - JDK 14
JDK Enhancement Proposals (JEP) has targeted JDK 14 release for 17 March 2020 for below features :
-
Pattern Matching for instanceof
-
Non-Volatile Mapped Byte Buffers
-
Helpful NullPointerExceptions
-
Switch Expressions (Standard)
-
Packaging Tool (Incubator)
-
NUMA-Aware Memory Allocation for G1
-
JFR Event Streaming<
-
Records (Preview)
-
Deprecate the Solaris and SPARC Ports
-
Remove the Concurrent Mark Sweep (CMS) Garbage Collector
-
ZGC on macOS
-
ZGC on Windows
-
Deprecate the ParallelScavenge + SerialOld GC Combination
-
Remove the Pack200 Tools and API
-
Text Blocks (Second Preview)
- Foreign-Memory Access API
Java 13 Features - JDK 13
-
Dynamic CDS Archives
-
ZGC: Uncommit Unused Memory
-
Reimplement the Legacy Socket API
-
Switch Expressions (Preview)
-
Text Blocks (Preview)
Java 12 Features
- Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
- Microbenchmark Suite
- Switch Expressions (Preview)
- JVM Constants API
- One AArch64 Port, Not Two
- Default CDS Archives
- Abortable Mixed Collections
- Promptly Return Unused Committed Memory from G1
Java 11 Features
-
181: Nest-Based Access Control
-
309: Dynamic Class-File Constants
-
315: Improve Aarch64 Intrinsics
-
318: Epsilon: A No-Op Garbage Collector
-
320: Remove the Java EE and CORBA Modules
-
321: HTTP Client (Standard)
-
323: Local-Variable Syntax for Lambda Parameters
-
324: Key Agreement with Curve25518 and Curve448
-
327: Unicode 10
-
328: Flight Recorder
-
329: ChaCha20 and Poly1305 Cryptographic Algorithms
-
330: Launch Single-File Source-Code Programs
-
331: Low-Overhead Heap Profiling
-
332: Transport Layer Security (TLS) 1.3
-
333: ZGC: A Scalable Low-Latency Garbage Collector(Experimental)
-
335: Deprecate the Nashorn JavaScript Engine
-
336: Deprecate the Pack200 Tools and API
Java 10 Features
- Local-variable type inference
- Experimental Java-based JIT compiler.This is the integration of the Graal dynamic compiler for the Linux x64 platform
- Application class-data sharing. This allows application classes to be placed in the shared archive to reduce startup and footprint for Java applications
- Time-based release versioning
- Parallel full GC
- Garbage-collector interface
- Additional Unicode language-tag extensions
- Root certificates
- Thread-local handshakes
- Heap allocation on alternative memory devices
- Remove the native-header generation tool - javah
- Consolidate the JDK forest into a single repository
Java 9 Features
- Modularization of the JDK under Project Jigsaw (Java Platform Module System)
-
jshell: The Java Shell (a Java REPL)
- Ahead-of-time compilation
- XML catalogs
- More concurrency updates. It includes a Java implementation of Reactive Streams, including a new Flow class that included the interfaces previously provided by Reactive Streams
- Variable handles: define a standard means to invoke the equivalents of various java.util.concurrent.atomic and sun.misc.Unsafe operations
- jlink: The Java Linker: create a tool that can assemble and optimize a set of modules and their dependencies into a custom run-time image. It effectively allows to produce a fully usable executable including the JVM to run it
- JavaDB was removed from JDK
- HiDPI graphics: automatic scaling and sizing
Java 8 Features
- Language-level support for lambda expressions and default methods (virtual extension methods) which allow the addition of methods to interfaces without breaking existing implementations.
- Project Nashorn, a JavaScript runtime which allows developers to embed JavaScript code within applications
- Annotation on Java types
- Unsigned integer arithmetic
- Repeating annotations
- Date and time API
- Statically-linked JNI libraries
- Launch JavaFX applications (direct launching of JavaFX application JARs)
- Remove the permanent generation
Java 7 Features
- JVM support for dynamic languages
- Compressed 64-bit pointers
- Strings in switch
- Automatic resource management in try-statement
- Improved type inference for generic instance creation, aka the diamond operator <>
- Simplified varargs method declaration
- Binary integer literals
- Allowing underscores in numeric literals
- Catching multiple exception types and rethrowing exceptions with improved type checking
- Concurrency utilities
- New file I/O library adding support for multiple file systems
- Timsort is used to sort collections and arrays of objects instead of merge sort
- Library-level support for elliptic curve cryptography algorithms
- An XRender pipeline for Java 2D, which improves handling of features specific to modern GPUs
- New platform APIs for the graphics features
- Enhanced library-level support for new network protocols, including SCTP and Sockets Direct Protocol
- Upstream updates to XML and Unicode
- Java deployment rule sets
Java 6 Features
- Support for older Win9x versions dropped
- Scripting Language Support
- Dramatic performance improvements for the core platform, and Swing.
- Improved Web Service support through JAX-WS.
- JDBC 4.0 support.
- Java Compiler API
- Upgrade of JAXB to version 2.0
- Support for pluggable annotations
- Many GUI improvements, such as integration of SwingWorker in the API, table sorting and filtering, and true Swing double-buffering (eliminating the gray-area effect).
- JVM improvements include: synchronization and compiler performance optimizations, new algorithms and upgrades to existing garbage collection algorithms, and application start-up performance.
- Java 6 can be installed to Mac OS X 10.5 (Leopard) running on 64-bit (Core 2 Duo and higher) processor machines.[54] Java 6 is also supported by both 32-bit and 64-bit machines running Mac OS X 10.6
Java 5 Features
- Generic
- Metadata
- Autoboxing/unboxing
- Enumerations
- Varargs
- Enhanced for each loop
- Improved
- Static imports
- Improvements - Semantics of execution for multi-threaded Java programs
- Improvements - Automatic stub generation for RMI objects
- Improvements - Swing: New skinnable look and feel, called synth
- Improvements - The concurrency utilities in package java.util.concurrent
- Improvements - Scanner class for parsing data from various input streams and buffers