Hi,
i am trying to use the nativeCompile, following the guide, but i have an error which i can't really understand.
My project is located at https://github.com/gotson/komga/tree/native if you want to reproduce.
> java -version
openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08, mixed mode, sharing)
I am running ./gradlew nativeCompile and get the following output:
> Task :komga:nativeCompile
[native-image-plugin] GraalVM Toolchain detection is disabled
[native-image-plugin] GraalVM location read from environment variable: JAVA_HOME
[native-image-plugin] Native Image executable path: /Users/groebroeck/.sdkman/candidates/java/22.3.r17-grl/lib/svm/bin/native-image
========================================================================================================================
GraalVM Native Image: Generating 'komga' (executable)...
========================================================================================================================
[1/7] Initializing... (0.0s @ 0.34GB)
Error: Main entry point class 'org.gotson.komga.ApplicationKt' neither found on the classpath nor on the modulepath.
Comment From: wilkinsona
It would appear that the classpath for nativeCompile is incorrect. Specifically komga/build/classes/kotlin/main/ or perhaps all of the main source set's output is missing. Spring Boot isn't involved in adding the main source set's output to the classpath of nativeCompile. It's the org.graalvm.buildtools.native plugin that does that.
My guess is that one of the many other plugins you're using has done something that prevents org.graalvm.buildtools.native from setting things up correctly. In your situation, I would spend some time reducing things down by removing one plugin at a time in an attempt to identify which combination is the cause of the problem. I'm afraid we don't have time to do that for you, particularly as there's nothing to suggest that Spring Boot is the cause.
Comment From: gotson
Thanks @wilkinsona, was trying my luck here but I understand. Will look elsewhere for support.