Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.2 KB

README.adoc

File metadata and controls

61 lines (42 loc) · 1.2 KB

Native sample with Spring Boot 3

This sample can be used to hack on Native with Spring Boot 3.

Note
This is a work in progress and requires a local build of Spring Boot.

Setup

You need to install a version of Spring Boot 3.0.0-SNAPSHOT from the aot branch

$ git checkout aot
$ ./gradlew publishToMavenLocal

You also need to have a native-image in your path. The easiest way to get started is with SDKMan:

$ sdk install java 22.0.0.2.r17-nik

Once GraalVM is installed, you need to use it in your shell:

$ sdk use java 22.0.0.2.r17-nik

Validate that GraalVM is available in your shell:

$ java -version
openjdk version "17.0.2" 2022-01-18 LTS
OpenJDK Runtime Environment GraalVM 22.0.0.2 (build 17.0.2+9-LTS)
OpenJDK 64-Bit Server VM GraalVM 22.0.0.2 (build 17.0.2+9-LTS, mixed mode, sharing)

Building

To build the project and generate a native image for it, run the following command:

$ ./mvnw package -Pnative

Running

One the build has completed, the native executable is in your target directory. You can run it as follows:

$ target/demo-native-sample