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

最后附上成功截图

祝你一切顺利📚

相关推荐
道可到21 分钟前
Java 反射现代实践速查表(JDK 11+/17+)
java
道可到32 分钟前
Java 反射现代实践指南(JDK 11+ / 17+ 适用)
java
玉衡子42 分钟前
九、MySQL配置参数优化总结
java·mysql
叽哥43 分钟前
Kotlin学习第 8 课:Kotlin 进阶特性:简化代码与提升效率
android·java·kotlin
麦兜*1 小时前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
带刺的坐椅1 小时前
DamiBus v1.1.0 发布(给单体多模块解耦)
java·事件总线·damibus
葡萄城技术团队1 小时前
用 Java 构建健壮 REST API 的 4 个关键技巧
java
杨杨杨大侠1 小时前
解密 atlas-mapper 框架 (9/10):故障排查与调试技巧
java·开源·github
Slaughter信仰1 小时前
深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)第十章知识点问答(10题)
java·jvm·数据库
麦兜*1 小时前
MongoDB 在物联网(IoT)中的应用:海量时序数据处理方案
java·数据库·spring boot·物联网·mongodb·spring