Spring Boot 4

 

Spring Boot now has strong GraalVM support.

<build>

    <plugins>

        <plugin>

            <groupId>org.graalvm.buildtools</groupId>

            <artifactId>native-maven-plugin</artifactId>

        </plugin>

    </plugins>

</build>

Build

mvn -Pnative native:compile

Produces

hello-api

Executable.

BEFORE GRAALVM

Java Source

javac

.class

JVM

Machine Code (JIT)

 

The JVM starts first.

Then loads classes.

Then verifies them.

Then interprets.

Then JIT compiles.

 

Spring Boot

java -jar app.jar

JVM starts

Load classes

JIT

Application starts

 

GraalVM

.class

Native Image

Machine Code