使用GraalVM对spring boot工程进行native编译:
系统:Centos
JDK:GraalVM JDK 21
报错:
If you are unable to resolve this problem, please file an issue with the error report at:
https://graalvm.org/support
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:10 min
[INFO] Finished at: 2023-10-18T19:34:06+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.27:compile (default-cli) on project spring-native-hello: Execution of /app_home/graalvm-community-opeome/workspace/spring-native-hello/target/classes:/home/chkusr/.m2/repository/org/springframework/boot/spring-boot-starter-web/3.1.4/spring-boot-starter-web-3.1.4.jar:/home/chkusr/boot/spring-boot-starter/3.1.4/spring-boot-starter-3.1.4.jar:/home/chkusr/.m2/repository/org/springframework/boot/spring-boot/3.1.4/spring-boot-3.1.4.jar:/home/chkusr/.m2/repositoboot-autoconfigure/3.1.4/spring-boot-autoconfigure-3.1.4.jar:/home/chkusr/.m2/repository/org/springframework/boot/spring-boot-starter-logging/3.1.4/spring-boot-starter-logging-3.1ch/qos/logback/logback-classic/1.4.11/logback-classic-1.4.11.jar:/home/chkusr/.m2/repository/ch/qos/logback/logback-core/1.4.11/logback-core-1.4.11.jar:/home/chkusr/.m2/repositoryslf4j/2.20.0/log4j-to-slf4j-2.20.0.jar:/home/chkusr/.m2/repository/org/apache/logging/log4j/log4j-api/2.20.0/log4j-api-2.20.0.jar:/home/chkusr/.m2/repository/org/slf4j/jul-to-slf4e/chkusr/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/home/chkusr/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar:/hoframework/boot/spring-boot-starter-json/3.1.4/spring-boot-starter-json-3.1.4.jar:/home/chkusr/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.y/com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2.jar:/home/chkusr/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.15.2/jackson-datatype-jdk8-2.15.2.jar:/home/chkusr/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.1jar:/home/chkusr/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.15.2/jackson-module-parameter-names-2.15.2.jar:/home/chkusr/.m2/repository/org/springtomcat/3.1.4/spring-boot-starter-tomcat-3.1.4.jar:/home/chkusr/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/10.1.13/tomcat-embed-core-10.1.13.jar:/home/chkusr/.m2/repoat-embed-el/10.1.13/tomcat-embed-el-10.1.13.jar:/home/chkusr/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.13/tomcat-embed-websocket-10.1.13.jar:/home/chkusr/spring-web/6.0.12/spring-web-6.0.12.jar:/home/chkusr/.m2/repository/org/springframework/spring-beans/6.0.12/spring-beans-6.0.12.jar:/home/chkusr/.m2/repository/io/micrometer/micro-observation-1.11.4.jar:/home/chkusr/.m2/repository/io/micrometer/micrometer-commons/1.11.4/micrometer-commons-1.11.4.jar:/home/chkusr/.m2/repository/org/springframework/spring-wer:/home/chkusr/.m2/repository/org/springframework/spring-aop/6.0.12/spring-aop-6.0.12.jar:/home/chkusr/.m2/repository/org/springframework/spring-context/6.0.12/spring-context-6.0.org/springframework/spring-expression/6.0.12/spring-expression-6.0.12.jar:/home/chkusr/.m2/repository/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/home/chkusr/.m2/repository/org/spring-core-6.0.12.jar:/home/chkusr/.m2/repository/org/springframework/spring-jcl/6.0.12/spring-jcl-6.0.12.jar --no-fallback -o /app_home/workspace/spring-native-hello/target/sprleDirectories=/app_home/workspace/spring-native-hello/target/graalvm-reachability-metadata/eaf9677a60ff2827b1ee2cb8f996d57bbca07038/ch.qos.logback/logback-classic/1.4.1,/app_home/t/graalvm-reachability-metadata/eaf9677a60ff2827b1ee2cb8f996d57bbca07038/com.fasterxml.jackson.core/jackson-databind/2.15.2,/app_home/workspace/spring-native-hello/target/graalvm-827b1ee2cb8f996d57bbca07038/org.apache.tomcat.embed/tomcat-embed-core/10.0.20 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.
以上报错的原因位于:
target/svm_err_b_20231018T193406.011_pid2327.md
里面列举了可能的错误原因1:
Based on the linker command output, possible reasons for this include:
1. It appears as though libz.a is missing. Please install it.
解决方法:安装libz.a,安装方法:
sudo yum install zlib-devel
标签:non,returned,repository,chkusr,spring,jar,报错,m2,home
From: https://www.cnblogs.com/jiayuan2006/p/17773213.html