The new version of Java SE 18 has already been released and these are its news

After six months of development, Oracle released the release of the new version of JavaSE 18 (Standard Edition), which uses the OpenJDK open source project as a reference implementation.

In this new version of Java SE 18 comes with the exception of the removal of some deprecated features, maintains compatibility with earlier versions of the Java platform and most previously written Java projects will continue to work unchanged when run with the new version.

Main new features of Java SE 18

In this new release of Java SE 18 the default encoding is UTF-8. Java APIs that process character-encoded text data will now use UTF-8 by default on all platforms, regardless of system settings and regional settings. To return the old behavior, where the encoding is chosen taking into account the locale of the system, you can use the parameter “-Dfile.encoding=COMPAT”.

Another of the changes that stands out is him redesigned the java.lang.reflect API implementation (Core Reflection), designed to obtain information about methods, fields and constructors of classes, as well as access to the internal structure of classes. the api java.lang.reflect itself has not changed, but is now implemented using the identifiers of methods provided by the module java.lang.invoke, instead of using bytecode generators. The change allowed to unify and facilitate the maintenance of the implementations of java.lang.reflect and java.lang.invoke.

In addition to this, it is also mentioned that the third preliminary implementation of Vector API is proposed, which provides functions for vector calculations that are performed using the vector instructions of the x86_64 and AArch64 processors and allow you to apply operations simultaneously to multiple values ​​(SIMD). Unlike the capabilities provided in the HotSpot JIT compiler for automatic vectorization of scalar operations, the new API allows you to explicitly control vectorization for parallel data processing.

It is also highlighted that added an SPI interface (service provider interface) to resolve host names and IP addresses, which allows you to use alternative resolvers in java.net.InetAddress that are not tied to the drivers provided by the operating system.

On the other hand, it has been proposed second preliminary implementation of Foreign Function & Memory API, with which applications can interact with code and data outside of the Java runtime. The new API allows efficient calling of non-JVM functions y access memory which is not managed by JVM. For example, you can call functions from external shared libraries and access process data without using JNI.

Added a second experimental implementation of pattern matching in expressions switch, which allows you to use flexible templates instead of exact values ​​in "case" tags, covering a number of values ​​at once, which previously required cumbersome strings of "if...else" expressions.

Package included com.sun.net.httpserver, which includes the jwebserver utility and API of the library with the implementation from a simple http server to serve static content (CGI and servlet-like controllers are not supported). The built-in http server is not optimized for workloads and does not support access control or authentication, as it is designed primarily for use in the development process of prototyping, debugging, and testing projects.

Of the other changes that stand out:

  • JavaDoc supports the tag "@snippet» to embed working examples and code snippets into API documentation, which can be accessed with validation tools, syntax highlighting, and IDE integration.
  • Deprecated and will be removed in a future release, the completion mechanism, as well as related methods such as Object.finalize(), Enum.finalize(), Runtime.runFinalization(), and System.runFinalization().
  • the garbage collectors ZGC (Z Garbage Collector), SerialGC and ParallelGC they support string deduplication.

JavaSE 18 is classified as a regular support release, with updates to be released before the next version. The long-term support (LTS) branch should be Java SE 17, which will receive updates until 2029.

It's important to remember that starting with the Java 10 release, the project switched to a new development process, which means a shorter cycle for new release formation. New functionality is now being developed in a constantly updated master branch, which includes changes already completed and from which branches branch out every six months to stabilize new releases.

Get Java SE 18

For those interested in being able to test this new release, please know that builds are ready for Linux (x86_64, AArch64), Windows (x86_64), and macOS (x86_64, AArch64) and can be obtained from the link below.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.