Build a minimal Java HTTP server with Eclipse Vert.x, test it asynchronously, package it as an executable JAR, and run it with Maven. This walkthrough follows the Java 8 and Vert.x 3.5.0 setup in Clement Escoffier’s Red Hat Developer tutorial, last updated April 22, 2022; those versions describe the tutorial, not a current version recommendation.
What you will build
The application consists of a verticle—a component whose start method runs when it is deployed. It creates an HTTP server on port 8080 and responds to requests with a short HTML greeting. Vert.x handlers process requests asynchronously, and a Future reports whether server startup succeeded or failed.
The example uses Apache Maven, Java 8, the conventional src/main/java and src/test/java directories, and io.vertx:vertx-core version 3.5.0. Java 8 is the minimum specified for this historical example. Check current Vert.x documentation before choosing versions for a new project.
Create the HTTP server
In the tutorial, the main class is MyFirstVerticle, which extends AbstractVerticle. Its start method creates the server, attaches a request handler, and begins listening on port 8080. The handler responds with the page content:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute<h1>Hello from my first Vert.x application</h1>
Server startup is asynchronous. The deployment completion Future lets the application report success or handle a failure, such as being unable to bind to port 8080 because another process is already using it. This is a useful distinction from treating server startup as an immediate, guaranteed operation.
Run the application during development
The tutorial uses the optional Vert.x Maven plugin to launch the application and support redeployment without additional configuration. From the project directory, run:
Rank #2
mvn compile vertx:run
When the server starts, open http://localhost:8080 in a browser. You should see the greeting from the request handler. If the server cannot start, check whether port 8080 is already occupied.
Test the asynchronous HTTP response
The sample test setup adds JUnit 4.12 and vertx-unit. Rather than assuming deployment and the HTTP request finish immediately, the test deploys the verticle asynchronously, sends a request through a Vert.x HTTP client, checks that the response body contains “Hello,” and completes an asynchronous test handle.
Free tools Windows power users keep installed
One-click scans. No signup required.
That coordination matters: the test must wait for deployment and the response before asserting the result. Vert.x assertions and asynchronous test handles provide a way to express those checks without treating asynchronous callbacks as synchronous work.
Run the test suite with:
mvn clean test
Package and run an executable JAR
Build the packaged application with:
mvn clean package
The tutorial’s Maven setup produces a standalone executable, or “fat,” JAR that includes dependencies. Its reported size was around 6 MB for that sample in the 2018 tutorial; it is a historical example, not a current size guarantee for Vert.x applications.
Rank #4
Run the resulting JAR with:
java -jar target/my-first-app-1.0-SNAPSHOT.jar
The server should again listen on port 8080. The tutorial also explains that the Vert.x Maven plugin is optional: it can package the application without configuration and provides a convenient development run and redeploy workflow.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What to build next
Make the port configurable
A fixed port is convenient for a first example but limits where the app can run. The tutorial’s next part replaces the hard-coded port with configuration, covering JSON configuration, deployment options, system properties, and environment variables such as HTTP_PORT.
Best Value
Add routes and web features
The following part introduces Vert.x Web for routing, serving static resources, and building a REST-style application. This is the natural next step when a single request handler is no longer enough to organize the application.
Source and version context
This walkthrough is based on Clement Escoffier’s Red Hat Developer tutorial, published March 13, 2018 and last updated April 22, 2022. Its Java 8 and Vert.x 3.5.0 instructions are specific to that example; they should not be read as a recommendation for a new project today.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

