springboot3 打包报错32-bit architecture x86 unsupported或者 returned non-zero result

springboot3 打包异常情况处理记录

在测试springboot3 native打包时候遇到的异常,百度和谷歌上方法都无法解决我的问题,最后记录一下我最后的原因和解决方案。

  • 前置要求:自己处理好vs的相关内容后

报错一:

shell 复制代码
[1/7] Initializing...                                                                                    (0.0s @ 0.29GB)
Error: Native-image building on Windows currently only supports target architecture: AMD64 (32-bit architecture x86 unsupported)
Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception

报错二

shell 复制代码
[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.18:compile (default-cli) on project graalvm-demo: Execution of D:\Program Files\Java\graalvm-ce-java17-22.3.0\bin\native-image.cmd @target\tmp\native-image-959794775419447688.args returned non-zero result -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

以下是截图示例

报错原因和解决方案

以下两个命令行窗口,一开始我使用的是第二个,从我异常截图中可以看到,其实要使用第一个命令行窗口

不一定每个人都是这种情况,只要是为了那些和我一样没注意的朋友解决问题,毕竟我从下午搞到了晚上,不需要和我一样的再浪费一个下午

使用第一个窗口(x64 Native Tools Command Prompt for VS 2022),重新去项目目录下执行打包指令

shell 复制代码
mvn -Pnative native:compile

最后附上成功截图

祝你一切顺利📚

相关推荐
飞鱼&43 分钟前
HashMap相关问题详解
java·hashmap
没有bug.的程序员1 小时前
Spring Cloud Alibaba 生态总览
java·开发语言·spring boot·spring cloud·alibaba
快乐非自愿2 小时前
Java垃圾收集器全解:从Serial到G1的进化之旅
java·开发语言·python
树在风中摇曳2 小时前
Java 静态成员与继承封装实战:从报错到彻底吃透核心特性
java·开发语言
键来大师5 小时前
Android15 RK3588 修改默认不锁屏不休眠
android·java·framework·rk3588
合作小小程序员小小店6 小时前
web网页开发,在线%考试管理%系统,基于Idea,vscode,html,css,vue,java,maven,springboot,mysql
java·前端·系统架构·vue·intellij-idea·springboot
小坏讲微服务7 小时前
Spring Boot整合Redis注解,实战Redis注解使用
spring boot·redis·分布式·后端·spring cloud·微服务·mybatis
多多*7 小时前
maven常用的命令
java·log4j·maven
xie_pin_an7 小时前
MyBatis-Plus 实战:MPJLambdaWrapper 多表联查用法全解析
java·spring boot·spring·mybatis
ᐇ9597 小时前
Java LinkedList集合全面解析:双向链表的艺术与实战
java·开发语言·链表