# 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](https://start.spring.io/)

![Screenshot 2022-03-25 at 11.44.55 AM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1648188915853/EadJBFMci.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](https://cdn.hashnode.com/res/hashnode/image/upload/v1648189457422/eA2VZIrZr.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](https://cdn.hashnode.com/res/hashnode/image/upload/v1648189363877/wsq139RvR.png)

Project is hosted on my github, which can be found [here](https://github.com/manitaggarwal/spring-native-testing).

