JDK 18 (Java 18) GA Release: New Features, Enhancements, and Upcoming Versions
JDK 18 has been released as a GA short‑term support version with six months of maintenance, introducing nine major JEPs—including UTF‑8 as the default charset, a simple HTTP server, a Vector API incubator, and a Foreign Function & Memory API—while preparing for JDK 19 in September and the next LTS, JDK 21, in 2023.
JDK 18 (Java 18) GA has been released. It is a short‑term support version that will receive six months of maintenance and can be used in production environments. According to the release roadmap, JDK 19 is scheduled for September of this year, and the next LTS release, JDK 21, will arrive in September 2023.
JDK 18 includes nine JEPs, hundreds of smaller enhancements, and more than a thousand bug fixes.
400: UTF‑8 by Default
408: Simple Web Server
413: Code Snippets in Java API Documentation
416: Reimplement Core Reflection with Method Handles
417: Vector API (Third Incubator)
418: Internet‑Address Resolution SPI
419: Foreign Function & Memory API (Second Incubator)
420: Pattern Matching for switch (Second Preview)
421: Deprecate Finalization for Removal
Default Encoding to UTF‑8
UTF‑8 is now the standard default charset for the Java API. This change ensures that APIs relying on the default charset behave consistently across all implementations, operating systems, locales, and configurations.
Simple HTTP Server
A command‑line tool is provided to launch a minimal web server that serves only static files. It does not support CGI or servlet‑like functionality and is useful for prototyping, temporary coding, and testing, especially in educational settings.
Code Snippets in Java API Documentation
An @snippet tag is introduced for the Standard Doclet of JavaDoc, simplifying the inclusion of example source code in API documentation.
Reimplement Core Reflection with Method Handles
Core reflection classes (java.lang.reflect.Method, Constructor, and Field) are reimplemented on top of java.lang.invoke method handles. Making method handles the underlying mechanism reduces maintenance and development costs for both the reflection and invoke APIs.
Vector API (Third Incubator)
An API is added to express vector computations that can be reliably compiled at runtime. On supported CPU architectures, the API leverages vector instructions to achieve performance superior to scalar calculations.
Internet‑Address Resolution SPI
A Service Provider Interface (SPI) is defined for host name and address resolution, allowing java.net.InetAddress to use resolvers other than the platform‑built‑in one.
Foreign Function & Memory API (Second Incubator)
This API enables Java programs to interoperate with code and data outside the Java runtime. By safely invoking external functions and accessing foreign memory, it allows native library calls without the fragility and dangers of JNI.
Pattern Matching for switch (Second Preview)
Pattern matching is added to switch expressions and statements, extending the language to allow concise and safe data‑centric queries. This feature is previewed in JDK 18.
Deprecate Finalization for Removal
Finalization is deprecated with the intention of removal in a future release. While still enabled by default, it can be disabled for early testing. Developers are encouraged to migrate to alternatives such as the try-with-resources statement.
More details can be found at https://openjdk.java.net/projects/jdk/18/ .
Download the JDK at https://jdk.java.net/18/ .
Promotional material: 120‑lecture SpringBoot source code video (18 GB) is linked in the original article.
Architect's Tech Stack
Java backend, microservices, distributed systems, containerized programming, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.