3

I am trying to build the native Quarkus image using the GraalVM but I am running into following Build Failure error:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.9.2.Final:build (default) on project converter-service: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:400)
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:240)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] -> [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.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

This is the first time I am working with GraalVM so I am bit confused.

Following are the basic information: Java version 17 Graavl VM version graalvm-ce-javaV-22.1.0

I followed the steps provided: https://stackoverflow.com/a/65837409/7584240 and https://github.com/graalvm/homebrew-tap.

Then I ran the command: mvn package -Pnative but running into the error. I tried to run even mvn package -Dquarkus.package.type=native but still getting the error.

I looked at the following issue: https://github.com/quarkusio/quarkus/issues/6884 but the solution is not working for me.

Can someone please help me?

Update

When the same application was tried on Linux then everything is working correctly but on Macos the above error is being occurred. Is it due to Macos settings or some environment problem? If so how to fix this.

BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98

1 Answers1

6

Able to figure out the issue so posting here:

  1. Increase the Docker memory resource from default 2GB to 8GB. (Docker Desktop -> Settings icon on top right -> Resources -> memory 2GB to 8GB apply and restart.)

  2. Then run the command mvn clean install -Dnative -Dquarkus.native.container-build=true

this should create a -runner file in project root/target folder.

BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98