Intro to Java's Simple Web Server
One of the most handy new features included in the Java 18 release (March 2022) was the new Simple Web Server, which makes it easy to spin up and configure an HTTP file server. It also exposes an API that extends the existing httpserver
package for building simple use cases. The new Simple Web Server is a useful tool that every Java developer should have in their bag of tricks. Let's check it out!
Simple Web Server on the command line
Java’s new jwebserver
command makes it simple to run a basic web server. It is analogous to the popular SimpleHTTPServer tool in the Python world.