springboot3.0整合GraalVM-Native-Support,打包本地exe(native-image)。添加native-maven-plugin插件,安装Visual studio

0.【idea新建一个springboot demo项目】

勾选 GraalVM Native Support。其它 略(太基础了)

在这里插入图片描述

1.【环境准备】安装GraalVM、VisualStudio、NativeImage

https://gitee.com/lishuoboy/lishuoboy-GraalVM/blob/master/doc/1.0环境准备.md

2.【打本地包】打包成exe并启动。性能高、包小、又不依赖JDK/JRE

https://gitee.com/lishuoboy/lishuoboy-GraalVM/blob/master/doc/2.0.打本地包exe并启动.md

3.exe与jar优缺点对比

exe jar
文件大小 70MB 20MB(需JRE)
启动耗时 0.118s 1.523s
内存占用 46MB 147MB

在这里插入图片描述
在这里插入图片描述

参考

demo项目地址 https://gitee.com/lishuoboy/lishuoboy-GraalVM

猜你喜欢

转载自blog.csdn.net/lishuoboy/article/details/129178432