Native Image Generation Failure | NoSuchFileException | Windows 10
See original GitHub issueError while building native image on getting-started in windows 10 (pom has 1.0.1 FInal and even tested with the next version):
Error: Invalid Path entry getting-started-1.0-SNAPSHOT-runner.jar
java.nio.file.NoSuchFileException: /project/getting-started-1.0-SNAPSHOT-runner.jar
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.0.1.Final:native-image (default) on project getting-started: Failed to generate a native image: 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:289)
[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:497)
[ERROR] at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR] at io.quarkus.builder.BuildContext$$Lambda$95/1029023736.run(Unknown Source)
[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:745)
[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:278)
[ERROR] ... 13 more
Note: I only have C Drive in my system.
System/Software Configuration Details:
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Native Image Generation Failure | NoSuchFileException
Error while building native image on getting-started in windows 10 (pom has 1.0.1 FInal and even tested with the next version): Error: ...
Read more >Native Image Generation Failure | NoSuchFileException | Windows 10
Error while building native image on getting-started in windows 10 (pom has 1.0.1 FInal and even tested with the next version):
Read more >graalvm/native-image - Gitter
Error : Unable to use jar-files from directory /Users/me/.local/bin/graalvm/Contents/Home/lib/svm/builder Caused by: java.nio.file.NoSuchFileException: ...
Read more >Cannot create native container on Windows - Stack Overflow
Final:native-image (default) on project getting-started: Failed to generate native image: io.quarkus.builder.BuildException: Build failure: ...
Read more >Building a Native Executable - Quarkus
By default, Quarkus waits for 60 seconds for the native image to start before automatically failing the native tests. This duration can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@maxandersen Nope, I’ve run all my tests using cmd.exe.
But I figured out what the problem was. Long story short: It is a Docker Desktop glitch, nothing to do with Quarkus. We just have to share our drive with Docker and everything should work fine.
Detailed description: In Docker Desktop for Windows it is necessary to select which drives are shared with Docker for mounting. When I’ve tried it for the first time, no drive was shared with Docker. In earlier versions of Docker Desktop I’ve got an error message when I tried to mount a folder from a non shared drive. In the actual version of Docker Desktop a Windows notification appears instead of an error where I can share the drive with one click. But this notification appears only if I use Windows style path for mounting (
d:\...
and not//d/...
) If my drive is not shared and I mount it with-v //d/...
option, then I don’t get error message nor notification, the container starts, but nothing is mounted. A Docker Desktop has a little strange behavior after sharing a drive. If I share a drive (in settings or by clicking on the notification) then mounting works inmediately with Windows style paths, but it is still not working with the//d/...
format (no error message, just nothing gets mounted). However after restarting Docker Desktop both formats are working fine. I’ve tried it several times by unsharing the drive, sharing it again, and this behavior is consistent.So the summary:
The Quarkus plugin specifies the volume mount in Unix path format, so it works only if the drive was previously shared. In other case we must share it and restart Docker Desktop to succeed.
great explanation @opeti and thanks @BogdanSukonnov for updating docs!