我正在尝试使用 GraalVM 和 native-image 构建本机应用程序。启动构建过程时发生错误。类路径中似乎缺少 cl.exe。就像 GraalVM 网站上提到的那样,我已经安装了“GRMSDKX_EN_DVD.iso”(适用于 Windows 7 和 .NET 的 Windows SDK)。我还尝试安装适用于 Windows 10 的 Windows SDK。
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>native-image -jar C:\Users\tm\Desktop\DemoGraalVM\target\Demo-1.0-SNAPSHOT.jar
[Demo-1.0-SNAPSHOT:28776] classlist: 2,435.83 ms, 1.16 GB
[Demo-1.0-SNAPSHOT:28776] setup: 646.59 ms, 1.16 GB
Error: Default native-compiler executable 'cl.exe' not found via environment variable PATH
Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
我正在使用 Windows 10,graalvm-ce-java8-windows-amd64-20.2.0。我还在运行 Visual Studio Community Edition 并使用 Visual Studio 2019 Developer Command Prompt v16.3.1。Java 应用程序是使用 Maven 在 IntelliJ Community Edition 中构建的。
我怎样才能解决这个问题?我在哪里下载 cl.exe 或哪个安装包包含此文件?