Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override Graalvm JVM version #1186

Open
padetiloye opened this issue Aug 28, 2024 · 0 comments
Open

Override Graalvm JVM version #1186

padetiloye opened this issue Aug 28, 2024 · 0 comments

Comments

@padetiloye
Copy link

padetiloye commented Aug 28, 2024

How do I specify the graalvm version used in the docker image? I do not see anyway this could be done in the documentation.

If we run the command to build the native-image, it's shows the version as GRAALVM_JVM_VERSION as 21 but I would like to use the Graalvm JVM version 22.

./mvnw package -Dpackaging=docker-native -Dmicronaut.runtime=lambda -Pgraalvm

Output

[INFO] 
[INFO] --- mn:4.6.1:docker-native (default-docker-native) @ default ---
[INFO] Using GRAALVM_JVM_VERSION: 21
[INFO] Using GRAALVM_ARCH: x64
[INFO] Using CLASS_NAME: io.micronaut.function.aws.runtime.MicronautLambdaRuntime

Reason for the upgrade

We noticed GRAALVM_JVM_VERSION 21 throws the following error while building the native image but GRAALVM_JVM_VERSION 22 doesn't.



[INFO] com.oracle.svm.core.util.UserError$UserException: The class java.util.Random has already been initialized (from 'META-INF/native-image/native-image.properties' in 'file:///home/app/classes/' with 'java.util.Random'); it is too late to register java.util.Random for build-time initialization. java.util.Random caused initialization of this class with the following trace: 
        at java.util.Random.<clinit>(Random.java:336)
        at java.util.concurrent.ForkJoinPool.submissionQueue(ForkJoinPool.java:2324)
        at java.util.concurrent.ForkJoinPool.poolSubmit(ForkJoinPool.java:2368)
        at java.util.concurrent.ForkJoinPool.execute(ForkJoinPool.java:2847)
        at com.oracle.svm.hosted.ImageClassLoader$1.execute(ImageClassLoader.java:93)
        at com.oracle.svm.hosted.NativeImageClassLoaderSupport$LoadClassHandler.lambda$initModule$2(NativeImageClassLoaderSupport.java:647)
        at com.oracle.svm.hosted.NativeImageClassLoaderSupport$LoadClassHandler$$Lambda/0x00000007c02df1c0.accept(Unknown Source)
        at jdk.internal.module.SystemModuleFinders$ModuleContentSpliterator.tryAdvance(SystemModuleFinders.java:573)
        at java.util.Spliterator.forEachRemaining(Spliterator.java:332)

Any suggestion ?

@padetiloye padetiloye changed the title Override Graalvm version Override Graalvm JVM version Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant