Configure the Java Build Environment

Several tasks must be completed to begin development. First, set up a Java build environment for developing your Helidon server application. Next, you must obtain the required libraries for the JavaScript microservices client. Finally, install Docker to create a containerized version of the application for Kubernetes deployment.

Before You Begin

Before you begin development make sure you have the following hardware and software.

Hardware, OS, and Editor

You need a machine or virtual machine running MacOS 10.13+, Windows 10+ and VirtualBox, or Linux. If running Windows, we recommend you set up your development environment in a Linux virtual machine using VirtualBox or Windows Professional and Docker Desktop. The latest versions of Ubuntu or CentOS should work fine for local development.

Note:

Windows 10, Virtual Box 5+ and Ubuntu 18.04 was used in the creation of this solution.

We also recommend that a Java IDE or programming editor is installed in your development environment.

Software to Install

Install the following software:

  • Java 11+

  • Maven 3.6+

  • cURL 7+

Create the Project Application

You build the application using Maven. You use the Helidon SE archetype to create your project and set up a "Hello World" Helidon application.

  1. In a command line window, create a directory to store your project files.
    mkdir helidon
  2. Go to the helidon directory.
    cd helidon
  3. Create an application project using a Maven archetype.
    mvn archetype:generate -DinteractiveMode=false \
    -DarchetypeGroupId=io.helidon.archetypes \
    -DarchetypeArtifactId=helidon-quickstart-se \
    -DarchetypeVersion=1.1.1 \
    -DgroupId=io.helidon.examples \
    -DartifactId=helidon-quickstart-se \
    -Dpackage=io.helidon.service.employee
  4. Go to the helidon-quickstart-se directory.
    cd helidon-quickstart-se
  5. Build the project.
    mvn package

    The mvn package command produces a .jar file which is your deployment package that contains all the required dependencies for the application. The first time you run the mvn package command, the required dependencies are downloaded and installed in your local maven repository. The initial load of this data can take a few minutes.

  6. Run the application.
    java -jar target/helidon-quickstart-se.jar
  7. In a web browser, open the http://localhost:8080/greet URL.

    The web browser shows the following message:

    {"message":"Hello World!"}
  8. Type Control-C to exit from the server.
  9. Go to the helidon directory.
    cd ..
  10. Make a copy of the helidon-quickstart-se project in the employee-app directory.
    cp -r helidon-quickstart-se employee-app