springboot 通过graalvm打包为exe文件。运行报错原因

报错内容:
The curpent machine does not support all of the following cPU features that arerequired by the image: [CX8, CMOU, FXSR, MMK, SSE, SSE2, SSE3, SSSE3, SSE4 1. SSE4 2,POPCNT,LZCNT,AUX, AUX2,BMI1,BMI2,FMA. F16CJ.Please rebuild the executable with an appropriate setting of the -marchoption.

报错原因:
native-image 默认参数 march的值为x86-64-v3。旧的cpu不支持。因此需要修改该参数为compatibility。
修改pom中插件:


                org.graalvm.buildtools
                native-maven-plugin
                
                    
                        -march=compatibility
                    
                
            

graalvm 打包命令:
mvn -Pnative native:compile
graalvm 环境搭建参考其他文章。
native-image march列表
springboot 通过graalvm打包为exe文件。运行报错原因_第1张图片

你可能感兴趣的:(springboot 通过graalvm打包为exe文件。运行报错原因)