Building native image in windows with quarkus

“mvn package -Pnative” builds the native image from quarkus project. Important step is we have to run that mvn command from “native tools commnad” of visual studio. If you run the command from regular command prompt you get the error below [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] C:\Program Files\GraalVM\graalvm-ce-java17-21.3.0\bin\native-image.cmd -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -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=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-UseServiceLoaderFeature -H:+StackTrace chinese-lang-1.0.0-SNAPSHOT-runner -jar chinese-lang-1.0.0-SNAPSHOT-runner.jar [chinese-lang-1.0.0-SNAPSHOT-runner:6432] classlist: 5,366.54 ms, 0.96 GB [chinese-lang-1.0.0-SNAPSHOT-runner:6432] setup: 943.11 ms, 0.96 GB Error: Default native-compiler executable 'cl.exe' not found via environment variable PATH Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain com.oracle.svm.core.util.UserError$UserException: Default native-compiler executable 'cl.exe' not found via environment variable PATH To prevent native-toolchain checking provide command-line option -H:-CheckToolchain at com.oracle.svm.core.util.UserError.abort(UserError.java:144) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.addSkipCheckingInfo(CCompilerInvoker.java:104) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.<init>(CCompilerInvoker.java:72) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker$WindowsCCompilerInvoker.<init>(CCompilerInvoker.java:110) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.create(CCompilerInvoker.java:84) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:864) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:527) at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:488) at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403) at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:569) at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:122) at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:599) [chinese-lang-1.0.0-SNAPSHOT-runner:6432] [total]: 6,384.40 ms, 0.96 GB # Printing build artifacts to: C:\Users\ozkan\projects\chinese-lang\target\chinese-lang-1.0.0-SNAPSHOT-native-image-source-jar\chinese-lang-1.0.0-SNAPSHOT-runner.build_artifacts.txt Error: Image build request failed with exit status 1 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.552 s [INFO] Finished at: 2021-11-03T21:07:37Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.4.1.Final:build (default) on project chinese-lang: 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: java.lang.RuntimeException: Failed to build native image [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:233) [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$2.execute(ExtensionLoader.java:821) [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] Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1 [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:369) [ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:213) [ERROR] ... 11 more [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. If you run the command from native tools result is below ...

November 3, 2021 · 4 min · Özkan Pakdil

How to delete all files except one in bash

I have been testing jhipster and its jdl, nice thing you can prepare a jdl file and it will generate all dao and pojos and admin panels. jhipster is generating a lot of files and I wanted to delete them all except the jdl file itself, here is how ls -a | grep -v test.jdl | xargs rm -rf

October 10, 2021 · 1 min · Özkan Pakdil

How to auto merge dependabot or Finally dependabot merges automatically

It has been long time there is a very nice and sweet bot around, it is called dependabot or check Dependabot is dependency upgrader for all projects. if you have nodejs project it updates those dependencies to latest, if you have maven same. And I have a small test framework which does spring template tests and release results, very good project for dependabot, it can fail anytime, not that important. and I have been trying to make dependabot PRs automerged. ...

August 5, 2021 · 1 min · Özkan Pakdil

Google App Engine is it expensive for me

I have been using a dedicated server for a very long time. I tried a cloud solution around 6 years ago. It was very expensive, and this year I decided to test cloud again. I have a spring boot application which needs 2gb ram and very small cpu usage, not much IO. I pay 30 euro(25.76 Pound sterling) for monthly dedicated server from hetzner server auction https://www.hetzner.com/sb And I registered for Google Cloud and used AppEngine https://cloud.google.com/appengine took me couple of hours to test and start my app, and I have 200 pounds(gift) from google cloud for the new user ...

June 27, 2021 · 1 min · Özkan Pakdil

Availability in numbers

This is worth to note. Availability in numbers Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. Availability is generally measured in number of 9s–a service with 99.99% availability is described as having four 9s. 99.9% availability - three 9s Duration Acceptable downtime Downtime per year 8h 45min 57s Downtime per month 43m 49.7s Downtime per week 10m 4.8s Downtime per day 1m 26.4s 99.99% availability - four 9s Duration Acceptable downtime Downtime per year 52min 35.7s Downtime per month 4m 23s Downtime per week 1m 5s Downtime per day 8.6s For more you can check https://github.com/donnemartin/system-design-primer ...

December 1, 2020 · 1 min · Özkan Pakdil