Hi, I have a basic SpringBoot 3.3.4 app and I am trying to build a native image, The OS is Ubuntu 22.04.5 LTS on a VM Intel 64 bits.
Linux ... 5.15.0-122-generic -Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
java -version
openjdk version "23" 2024-09-17
OpenJDK Runtime Environment GraalVM CE 23+37.1 (build 23+37-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 23+37.1 (build 23+37-jvmci-b01, mixed mode, sharing)
gradle --version
Gradle 8.10.1
Build time: 2024-09-09 07:42:56 UTC Revision: 8716158d3ec8c59e38f87a67f1f311f297b79576
Kotlin: 1.9.24 Groovy: 3.0.22 Ant: Apache Ant(TM) version 1.10.14 compiled on August 16 2023 Launcher JVM: 23 (GraalVM Community 23+37-jvmci-b01) Daemon JVM: /opt/graalvm-community-openjdk-23+37.1 (no JDK specified, using current Java home) OS: Linux 5.15.0-122-generic amd64
native-image --version
native-image 23 2024-09-17
GraalVM Runtime Environment GraalVM CE 23+37.1 (build 23+37-jvmci-b01)
Substrate VM GraalVM CE 23+37.1 (build 23+37, serial gc)
I have attached the error log and the build.gradle file
Comment From: snicoll
@jbiancot that does not look like a Spring Boot problem to me.
/// These lines brakes the: gradle nativeCompile
jar {
archiveClassifier=''
enabled = false
}
The JAR is not generated and nativeCompile which is a task of the Native Build Tools plugin uses it to source the main class.
Comment From: jbiancot
Thanks, so stupid of me, I didn't see I have a comment about "These lines brakes the: gradle nativeCompile", after I commented it out, and I add the:
id 'org.graalvm.buildtools.native' version '0.10.3'
It worked like charm :)