[GR-60766] [Native Image] Pico CLI native app fails to run on Graal 23 #10390
Open
Description
Describe the Issue
I am using Pico CLI alongside with Graal to create a native image for Certificate Ripper. I noticed that the Pico CLI app is working on Graal 22 but not on Graal 23 anymore when creating/running a native image.
Using the latest version of GraalVM can resolve many issues.
- I tried with the latest version of GraalVM.
GraalVM Version
openjdk 23.0.1 2024-10-15
OpenJDK Runtime Environment GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01, mixed mode, sharing)
Operating System and Version
Mac OS X 14.5
Troubleshooting Confirmation
- I tried the suggestions in the troubleshooting guide.
Run Command
./target/crip
Expected Behavior
No runtime exception
Actual Behavior
Exception in thread "main" picocli.CommandLine$InitializationException: Cannot instantiate nl.altindag.crip.command.VersionProvider: the class has no constructor
at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5689)
at picocli.CommandLine$DefaultFactory.createVersionProvider(CommandLine.java:5675)
at picocli.CommandLine$Model$CommandSpec.updateVersionProvider(CommandLine.java:7494)
at picocli.CommandLine$Model$CommandSpec.updateCommandAttributes(CommandLine.java:7459)
at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:11845)
at picocli.CommandLine$Model$CommandSpec.forAnnotatedObject(CommandLine.java:6392)
at picocli.CommandLine.<init>(CommandLine.java:230)
at picocli.CommandLine.<init>(CommandLine.java:224)
at picocli.CommandLine.<init>(CommandLine.java:199)
at nl.altindag.crip.App.main(App.java:25)
at java.base@23.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.lang.NoSuchMethodException: nl.altindag.crip.command.VersionProvider.<init>()
at java.base@23.0.1/java.lang.Class.checkConstructor(DynamicHub.java:1171)
at java.base@23.0.1/java.lang.Class.getConstructor0(DynamicHub.java:1365)
at java.base@23.0.1/java.lang.Class.getDeclaredConstructor(DynamicHub.java:3004)
at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5660)
at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5687)
... 10 more
Steps to Reproduce
- Install Graal 22 and 23 from https://www.graalvm.org/downloads/
- Make sure your java home is configured to point to version Graal 22
- Install maven
- run
git clone https://github.com/Hakky54/certificate-ripper.git
- run
mvn clean install -Pnative-image
- run
./target/crip
(it does not give a runtime exception) - configure java home to graal 23
- repeat step 5 and 6 and the runtime exception will be shown
Additional Context
No response
Run-Time Log Output and Error Messages
No response