Skip to main content

Command Palette

Search for a command to run...

Using Spring Native

Published
Using Spring Native

GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The first production-ready version, GraalVM 19.0, was released in May 2019. Problem with GraalVM is that it does not do well with Java Reflections, Proxies, Dependency Injections and a few other things. Where the Spring team with Spring Native has solved almost all the problems for a Restful Application.

A Typical Spring Boot project can be generated at Spring Initialiser

Screenshot 2022-03-25 at 11.44.55 AM.png

Application JAR typically is compile using

mvn clean package

Which can now be swapped to

mvn -Pnative clean package

As the adding of spring native adds a special profile to the POM of the application. Screenshot 2022-03-25 at 11.53.52 AM.png

Which will create a platform specific binary, thus giving significant speed boost to the application at startup times and remove the requirement of JRE in the system running the binary.

Screenshot 2022-03-25 at 11.49.42 AM.png

Project is hosted on my github, which can be found here.

More from this blog

Manit Aggarwal

12 posts