Graal VM 踩坑历程 1-安装配置篇
1.官网下载
本文寡人用Windwos10做示例
2.配置Graal VM环境变量
>java -version openjdk version "1.8.0_302" OpenJDK Runtime Environment (build 1.8.0_302-b07) OpenJDK 64-Bit Server VM GraalVM CE 20.3.3 (build 25.302-b07-jvmci-20.3-b20, mixed mode)
3.安装native-image
配置好graalVM后,可在CMD直接以下敲命令
>gu install native-image Downloading: Component catalog from www.graalvm.org Processing Component: Native Image Downloading: Component native-image: Native Image from github.com I/O error occurred: Timeout while connecting to https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.3.3/native-image-installable-svm-java8-windows-amd64-20.3.3.jar
4.安装VS MSVC SDK
选择单个组件,搜索MSVC选择以下组件安装
SDK也需要下载(LIB,INCLUDE环境变量,在编译时有用到)
静待几分钟下载安装
配置VS环境变量
C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.16.27023inHostX64x64
C:Program Files (x86)Windows Kits10Include10.0.19041.0ucrt;C:Program Files (x86)Windows Kits10Include10.0.19041.0um;C:Program Files (x86)Windows Kits10Include10.0.19041.0shared;C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.16.27023include;
C:Program Files (x86)Windows Kits10Lib10.0.19041.0umx64;C:Program Files (x86)Windows Kits10Lib10.0.19041.0ucrtx64;C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.16.27023libx64;
异常情况
未配置VS环境变量
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
未配置INCLUDE和LIB环境变量
Error: Error compiling query code (in C:UsersADMINI~1AppDataLocalTempSVM-450436370752152138AArch64LibCHelperDirectives.c). Compiler command C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.16.27023inHostX64x64cl.exe /WX /W4 /wd4244 /wd4245 /wd4800 /wd4804 /wd4214 /FeC:UsersADMINI~1AppDataLocalTempSVM-450436370752152138AArch64LibCHelperDirectives.exe C:UsersADMINI~1AppDataLocalTempSVM-450436370752152138AArch64LibCHelperDirectives.c output included error: [AArch64LibCHelperDirectives.c, C:UsersADMINI~1AppDataLocalTempSVM-450436370752152138AArch64LibCHelperDirectives.c(1): fatal error C1034: stdio.h: ·]
上一篇:
IDEA上Java项目控制台中文乱码