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

最后附上成功截图

祝你一切顺利📚

相关推荐
pianmian12 小时前
类(JavaBean类)和对象
java
我叫小白菜3 小时前
【Java_EE】单例模式、阻塞队列、线程池、定时器
java·开发语言
Albert Edison3 小时前
【最新版】IntelliJ IDEA 2025 创建 SpringBoot 项目
java·spring boot·intellij-idea
超级小忍4 小时前
JVM 中的垃圾回收算法及垃圾回收器详解
java·jvm
weixin_446122464 小时前
JAVA内存区域划分
java·开发语言·redis
勤奋的小王同学~4 小时前
(javaEE初阶)计算机是如何组成的:CPU基本工作流程 CPU介绍 CPU执行指令的流程 寄存器 程序 进程 进程控制块 线程 线程的执行
java·java-ee
TT哇4 小时前
JavaEE==网站开发
java·redis·java-ee
2401_826097624 小时前
JavaEE-Linux环境部署
java·linux·java-ee
缘来是庄5 小时前
设计模式之访问者模式
java·设计模式·访问者模式
Bug退退退1235 小时前
RabbitMQ 高级特性之死信队列
java·分布式·spring·rabbitmq