JDK 18 Adds Simple Web Server
Written by Kay Ewbank   
Thursday, 24 March 2022

Java Development Kit (JDK) 18 is now available as an official production release, along with Java 18. The new version of standard Java JDK 18 was announced by the Open JDK group and Oracle released the new version under a commercial license for those using the Oracle JDK release as part of an Oracle product or service, or for those who want to be able to get commercial support.

Improvements to the new release include a simple web server for prototyping and testing, and the ability to add code snippets in Java API documentation.

corretto

The simple web server is very simple; you get a command-line tool that starts a minimal web server that serves static HTTP files only. No CGI or servlet-like functionality is available. The JDK team says the tool will be useful for prototyping, ad-hoc coding, and testing purposes.

The new release also includes the ability to add code snippets in Java API documentation. The reason for this addition is to help validate source code fragments by providing API access to those fragments. The OpenJDK group says that:

"Although correctness is ultimately the responsibility of the author, enhanced support in javadoc and related tools can make it easier to achieve."

UTF-8 becomes the default charset of the standard Java APIs in this version. This means that APIs that depend upon the default charset will behave consistently across all implementations, operating systems, locales, and configurations, and will help make Java programs more predictable and portable when their code relies on the default charset.

There are also several incubator APIs included in this release, starting with an updated version of the incubating vector API that can be used to make use of CPU architectures that provide scalable vector extensions.

The incubating Foreign Function and Memory API  has also been updated. This lets Java programs interoperate with code and data outside of the Java runtime. The API handles invoking foreign functions and memory so Java programs can call native libraries and process native data "without the brittleness and pitfalls of JNI".
A third incubator is pattern matching for switch. This provides a way to use pattern matching for switch expressions and statements, along with extensions to the language of patterns.

JDK 18 and Java 18 are available now. 

corretto

 

More Information

JDK 18 On OpenJDK

Related Articles

Java 16 Hits General Availability

Microsoft Jumps on the OpenJDK Bandwagon 

Foojay - All About Java and the OpenJDK

Where's Java Going In 2020

The True State of Java and its Ecosystem

Java 15 Reaches General Availability 

Java At 25

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Quantum Computing Prize Awarded
05/04/2024

John Preskill, Professor of Theoretical Physics at the California Institute of Technology, is the eighth recipient of the John Stewart Bell Prize for Research on Fundamental Issues in Quantu [ ... ]



Liberica Alpaquita Containers Now Come With CRaC
23/04/2024

Bellsoft has added CRaC support to its ready-to-use Alpaquita container images. This will enable developers to seamlessly integrate CRaC into their projects for performant Java in the Cloud.


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info