0

How to create a Quarkus application executable on Windows?

I have created a first Quarkus app from its initializer https://code.quarkus.io/

I have been able to do correctly all the steps indicated in the README.md except the creation of an native executable.

To be more precise, I have been able to create it, but I have not been able to run it, because it seems that the executable that is created is for Linux:

<<The produced executable will be a 64-bit Linux executable, so depending on your operating system it may no longer be runnable. However, it’s not an issue as we are going to copy it to a Docker container. Note that in this case the build itself runs in a Docker container too, so you don’t need to have GraalVM installed locally.>>

  1. Running the application in dev mode:

    mvnw compile quarkus:dev

  2. Packaging and running the application as a jar:

    mvnw package java -jar target/quarkus-app/quarkus-run.jar

  3. Packaging and running the application as an uber-jar:

    mvnw package -Dquarkus.package.type=uber-jar java -jar target/*-runner.jar

  4. Creating a native executable in a container: (because I don't have GraalVM)

    mvnw package -Pnative -Dquarkus.native.container-build=true

JLLMNCHR
  • 1,551
  • 5
  • 24
  • 50
  • I did such in the past, along with a gitlab pipeline that builds the windows native image. You can check my repo for inspiration https://gitlab.com/bosacky/lego-crawler/-/blob/master/.gitlab-ci.yml – Pavel Jan 23 '23 at 11:26
  • I appreciate the information, but I lack the level to take advantage of it – JLLMNCHR Jan 23 '23 at 12:26
  • there are few prerequisites on windows (I mentioned in my readme): 1. Install Visual Studio with C (MSVC is necessary) 2. Run x64 Native Tools Command Prompt for VS 2019 3. Run `mvn -DskipTests package -Pnative` from that command line – Pavel Jan 23 '23 at 12:29
  • Okay, I'll try it later. Well lately I'm installing too many things on my computer. Thanks! – JLLMNCHR Jan 23 '23 at 12:32
  • I put screen shots at the bottom of this [page](https://ozkanpakdil.github.io/quarkus,graalvm/2021/11/03/quarkus-build-native-windows.html) it may help – ozkanpakdil Jan 27 '23 at 18:40

0 Answers0