You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GraalVM Native Image Windows平台报错:windows-amd64不被支持

解决GraalVM Native Image报错"windows-amd64 isn't supported"

可能的修复步骤

1. 升级或确认GraalVM版本兼容性

  • 确保使用的GraalVM版本支持Windows 64位系统,推荐使用GraalVM 21及以上的稳定版本,旧版本可能对新Windows版本(如Win11)支持不足。
  • 验证当前GraalVM版本:执行以下命令,输出应包含GraalVM标识:
    java -version
    

2. 安装native-image组件

  • GraalVM默认未包含native-image工具,需手动安装:
    gu install native-image
    
  • 安装完成后执行native-image --version,确认工具可正常运行。

3. 匹配系统与GraalVM架构

  • 确认Windows系统为64位(x86_64/amd64),且下载的GraalVM是对应架构版本,禁止混用32位和64位包。
  • 查看系统架构:打开命令提示符执行wmic os get osarchitecture,确认输出为64-bit。

4. 调整环境变量优先级

  • 将GraalVM安装目录下的bin文件夹移至系统环境变量PATH的最前端,避免调用到其他JDK的工具。
  • 验证:执行where java,输出路径需指向GraalVM安装目录。

5. 显式指定目标平台参数

  • 若上述步骤无效,尝试在命令中明确指定平台:
    native-image -jar NativeTest2.jar --platform=windows-x86_64
    
    或使用兼容的标识:
    native-image -jar NativeTest2.jar --platform=windows-amd64
    

6. 配置Windows编译环境

  • Native Image依赖Windows SDK和C构建工具,需安装Visual Studio Build Tools并勾选"C build tools"组件。
  • 运行vcvars64.bat(通常位于C:\Program Files\Microsoft Visual Studio\<版本>\BuildTools\bin目录)初始化编译环境后,再执行native-image命令。

内容的提问来源于stack exchange,提问作者fladon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 15:15:42