Return to site

JAVA 18 NEWS: Simple web server in the JDK #jep408

January 9, 2022

JDK 18 will come with an embedded mini web server.

It will allow to deal with static files from a directory thanks to command line tool: 𝒋𝒘𝒆𝒃𝒔𝒆𝒓𝒗𝒆𝒓.

By default, it uses 𝒍𝒐𝒄𝒂𝒍𝒉𝒐𝒔𝒕 and the port 80 and targets the current directory.

The class 𝑚𝒊𝒎𝒑𝒍𝒆𝑭𝒊𝒍𝒆𝑚𝒆𝒓𝒗𝒆𝒓 coming with it, lets you instantiate that web server, by code:

 This tool will be useful for prototyping, ad-hoc coding, and testing purposes, particularly in educational contexts.