What’s New in JDK 18? A Complete Overview of Its Key Features
The article outlines the March 22, 2022 release of JDK 18, highlights its nine new features—including UTF‑8 as the default charset, a simple web server, and a foreign function & memory API—while noting its short‑term support compared to the LTS JDK 17.
Java Development Kit (JDK) 18 was released on March 22, 2022. The standard Java version includes nine new features, which were frozen on December 9 and entered the first Ramp‑down phase.
Note that JDK 17 is a long‑term support (LTS) version with at least eight years of Oracle support, while JDK 18 is a short‑term feature release supported for six months. Early‑access builds for Linux, Windows and macOS are available at https://jdk.java.net/18/.
JDK 18 new features include:
JEP 400: UTF‑8 as the default charset . The default charset for all Java API calls becomes UTF‑8 across all platforms.
JEP 408: Simple web server . A command‑line tool that serves static files, useful for prototyping, temporary coding and testing, especially in teaching environments.
JEP 413: @snippet tag for JavaDoc . Introduces an @snippet tag to embed example source code in API documentation.
JEP 416: Core reflection reimplemented with method handles . Refactors java.lang.reflect on top of java.lang.invoke method handles, reducing maintenance cost.
JEP 417: Vector API (third incubator) . Provides an API for vector computations that can be compiled to optimal CPU vector instructions at runtime.
JEP 418: Internet address resolution SPI . Defines a service‑provider interface for hostname and address resolution, allowing java.net.InetAddress to use non‑built‑in resolvers.
JEP 419: Foreign function & memory API (second incubator) . Offers a safe way for Java programs to call native code and access off‑heap memory without the fragility of JNI.
JEP 420: Switch pattern‑matching expressions . Extends switch with pattern matching for more concise and safe data‑centric queries.
JEP 421: Deprecate Finalization . Removes the legacy finalization mechanism due to unpredictable delays and thread‑safety issues; recommends using try‑with‑resources or cleaners.
The second Ramp‑down phase begins on January 20, 2022, with RC builds scheduled for February 10 and February 24, 2022, and the final stable release on March 22, 2022. See the JDK announcement page for the latest information.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
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.
