JDK 18 / Java 18 GA released: Fixed over one thousand bugs
3 min readJDK 18 / Java 18 GA released: Fixed over one thousand bugs
JDK 18 / Java 18 GA released: Fixed over one thousand bugs.
JDK 18 / Java 18 GA released. JDK 18 is a short-term maintenance release and will be supported for six months. Still, it can be used in production environments.
According to the development plan, JDK 19 will be released in September this year, while the next LTS version, JDK 21, will be released in September 2023.
JDK 18 includes a total of 9 JEPs, as well as hundreds of smaller enhancements and over one thousand bugs 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 is UTF-8
Specifies UTF-8 as the default character set for the standard Java API. With this change, APIs that rely on the default charset will be consistent across all implementations, operating systems, locales, and configurations.
Simple HTTP Server
Provides a command line tool to start a minimal web server that only serves static files. There is no CGI or servlet-like functionality available. The tool can be used for prototyping, ad hoc coding and testing purposes, especially in educational settings.
Code snippets from the Java API documentation
Introduces a @snippet tag for JavaDoc’s Standard Doclet to simplify example source code in API documentation.
Reimplementing Java Core Reflection with Method Handles
Reimplement java.lang.reflect.Method, Constructor and Field based on the java.lang.invoke method handle. Making method handles the underlying mechanism for reflection will reduce maintenance and development costs for the java.lang.reflect and java.lang.invoke APIs.
Vector API (3rd incubation)
Introduces an API to express vector computations that compile reliably at runtime, optimizing vector instructions on supported CPU architectures to achieve better performance than scalar computations.
Internet Address Resolution SPI
Defines a Service Provider Interface (SPI) for host name and address resolution so that java.net.Inet Address can use resolvers other than the platform’s built-in resolvers.
External functions and memory API (incubating the second time)
Introduces an API through which Java programs can interoperate with code and data outside of the Java runtime.
By efficiently calling external functions, and safely accessing external memory, this API enables Java programs to call native libraries and manipulate native data without the fragility and dangers of JNI.
Switch pattern matching (preview the second time)
switch
Enhance the Java programming language with pattern matching of expressions and statements, and extensions to the pattern language. Extends pattern matching switch
into , allowing expressions to be tested against some patterns, so that complex data-oriented queries can be expressed concisely and safely. This is a preview language feature in JDK 18.
Deprecate Finalization for removal in the future
Deprecate Finalization so that it will be removed in a future release. Currently Finalization is still enabled by default, but it can be disabled for early testing. In later versions, it will be disabled by default first, and will be completely removed in future versions. Maintainers of libraries and applications that depend on Finalization should consider migrating to other resource management techniques, such as try-with-resources
statements .
For more details, please check: https://openjdk.java.net/projects/jdk/18/
Download: https://jdk.java.net/18/