question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native image build error on Win10

See original GitHub issue

Describe the bug I am running on a Win10 laptop, and tried to build a native image using GraalVM CE 19.2.1 after creating a basic project from https://code.quarkus.io/ (version 1.0.0.RC1) and I get an “augmentation” error. I tried from the Windows command line and from a Git Bash, both result in the same error.

Expected behavior Well, getting a native image generated 😉

Actual behavior

[INFO] --- quarkus-maven-plugin:1.0.0.CR1:build (default) @ code-with-quarkus ---
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Beginning quarkus augmentation
[INFO] [org.jboss.threads] JBoss Threads version 3.0.0.Final
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: C:\Users\vleon\code-with-quarkus\target\code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar\code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from C:\Users\vleon\code-with-quarkus\target\code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar\code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit GraalVM CE 19.2.1
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] C:\Users\vleon\graalvm-ce-19.2.1\bin\native-image.cmd -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar code-with-quarkus-1.0.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-JNI -H:-UseServiceLoaderFeature -H:+StackTrace code-with-quarkus-1.0.0-SNAPSHOT-runner
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  18.364 s
[INFO] Finished at: 2019-11-13T21:09:52+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.0.0.CR1:build (default) on project code-with-quarkus: Failed to build a runnable JAR: Failed to augment application classes: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:294)
[ERROR]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR]         at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
[ERROR]         at java.lang.Thread.run(Thread.java:748)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.lang.RuntimeException: Image generation failed
[ERROR]         at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:283)
[ERROR]         ... 12 more

To Reproduce Steps to reproduce the behavior:

  1. Unzip the attached project code-with-quarkus.zip
  2. Set the GRAALVM_HOME and JAVA_HOME env variables, update PATH with the updated JAVA_HOME\bin
  3. Run mvnw package -Pnative

Environment (please complete the following information):

  • OS: Windows 10
  • Quarkus: 1.0.0.CR1
  • GraalVM: 19.2.1

Additional context Setting env variables this way:

set GRAALVM_HOME=<PATH TO>\graalvm-ce-19.2.1
set JAVA_HOME=<PATH TO>\graalvm-ce-19.2.1
set PATH=%JAVA_HOME%\bin;%PATH%

Attached the full Maven log (with -e option). build_native.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Karmcommented, Nov 13, 2020

@gsmet This issue can be closed. It is no longer a problem on Windows.

1reaction
jaikirancommented, Nov 20, 2019

I created https://github.com/oracle/graal/issues/1843 to have it tracked in Graal

Read more comments on GitHub >

github_iconTop Results From Across the Web

Native-image building on Windows currently only supports ...
windows 10 Native Build error - Native-image building on Windows currently only supports target architecture: AMD64 (x86 unsupported).
Read more >
Getting Started - GraalVM
The native-image tool can be used to build a native executable, which is the default, or a native shared library. This quick start...
Read more >
graalvm/native-image - Gitter
Hi, i'm trying to generate a native image on Windows 10. I installed Visual Studio to have ... UserError$UserException: Error compiling query code...
Read more >
Ngen.exe (Native Image Generator) - .NET Framework
The runtime can use native images from the cache instead of using the just-in-time (JIT) compiler to compile the original assembly.
Read more >
Native image failures on Windows - Google Groups
Error : Image build request failed with exit status 1 ... at http://karols.github.io/blog/2019/05/12/native-image-on-windows-10-x64/ without any change.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found