import com.sun.net.httpserver.HttpServer; import java.net.InetSocketAddress; public class main { private static HttpServer server; private static int port = 8888; public static void main(String[] args) throws Exception { server = HttpServer.create(new InetSocketAddress(port), 0); server.setExecutor(null); // creates a default executor server.start(); System.out.println("HTTP server started (listening on port " + port + "!)"); } }