Kotlin + Quarkus - Hello world example

Hello everyone, Today we will learn how how to create a Kotlin + Quarkus hello world application.

More Quarkus Related topics,

Create Quarkus Project With code.quarkus.io

Launch Quarkus Initializr using https://code.quarkus.io/ link
Specify Project Details 

Look at the above diagram, we have specified the following details:
  • Build Tool: Gradle with Kotlin
  • Group: org.knf.dev.demo
  • Artifact: kotlin-quarkus-helloworld
  • Search & Pick extensions: RESTEasy JSON-B
Once, all the details are entered, click on Generate your application button will generate a Quarkus project and downloads it. Next, Unzip the downloaded zip file and import it into your favorite IDE.

Import project in your favorite IDE.I am using IntelliJ IDEA.Gradle would take some time to download all the dependencies and initialize the project.

Project Directory:

Download the project source code and review the project folder structure :

Gradle Build:

Review the build.gradle.kts file, this should be self-explanatory.
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.5.31"

repositories {

val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project

dependencies {

group = "com.knf.dev.demo"
version = "1.0.0-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "11"
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "11"

The Quarkus core Technologies:
  • Quarkus uses RESTEasy for the JAX-RS endpoint. 
  • Quarkus uses Vert.x and Netty at its core, providing reactive and non-blocking HTTP layer. 
  • Quarkus uses JBoss Log Manager as the default logging framework. 
  • Quartus utilizes a modified version of Undertow  that runs on top of Vert.x 
  • Quarkus uses SmallRye Config, implementation of Eclipse MicroProfile Config, for configuration data.
For testing:
  • Quarkus uses JUnit 5 for testing. 
  • Quarkus uses rest-assured to test HTTP endpoints.

Quarkus JAX-RX endpoint

package com.knf.dev.demo

import javax.ws.rs.GET
import javax.ws.rs.Path
import javax.ws.rs.Produces
import javax.ws.rs.core.MediaType

class GreetingResource {
fun hello(): String {
return "Hello World"


Build application jar file: gradle build

Start application: java -jar quarkus-run.jar

Open the browser and hit the endpoint http://localhost:8080/hello

Popular posts from this blog

Learn Java 8 streams with an example - print odd/even numbers from Array and List

Java Stream API - How to convert List of objects to another List of objects using Java streams?

Spring Boot + Mockito simple application with 100% code coverage

Registration and Login with Spring Boot + Spring Security + Thymeleaf

Java, Spring Boot Mini Project - Library Management System - Download

Spring boot video streaming example-HTML5

ReactJS, Spring Boot JWT Authentication Example

Java - Blowfish Encryption and decryption Example

Custom Exception Handling in Quarkus REST API

Spring Boot + OpenCSV Export Data to CSV Example