IntelliJ IDEA 2020.1 Help

Helidon

Helidon is a Java framework for writing microservices. IntelliJ IDEA provides the following:

Create a new Helidon project

  1. From the main menu, select File | New | Project.

  2. In the New Project wizard, select MicroProfile and choose the Default starter service https://start.microprofile.io.

    New MicroProfile project wizard

    Click Next.

  3. Configure the following MicroProfile project settings:

    • Group: com.example

    • Artifact: hello-helidon

    • MicroProfile version: MP32

    • MicroProfile Runtime: Helidon

    Click Next.

  4. Select the necessary specifications for your application and click Next.

  5. If necessary, change the project name, location, and other settings. Click Finish.

The generated project contains a REST endpoint named HelloController with the following code:

package com.example.hello.helidon; import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.Path; /** * */ @Path("/hello") @Singleton public class HelloController { @GET public String sayHello() { return "Hello World"; } }

You can open the Endpoints tool window (View | Tool Windows | Endpoints) and see this endpoint:

HelloController endpoint in the Endpoints tool window

Run the Helidon application

  1. Open the io.helidon.microprofile.server.Main class from the Helidon library.

  2. In the gutter, click The Run icon and run the Main.main() method Ctrl+Shift+F10.

  3. In the Edit Configuration dialog, set Use classpath of module to your application's module: hello-helidon.

    Click Run.

In the Run tool window, you will see that the server is running on http://localhost:8080. Open this URL in a web browser to see the landing page of the MicroProfile server.

The default root is located at /data, as defined by @ApplicationPath("/data") in the HellohelidonRestApplication class. Open http://localhost:8080/data/hello to see the output produced by the HelloController endpoint: Hello World.

Last modified: 25 May 2020