quarkus: Native image build fails with unknown arguments on Windows
Describe the bug mvn package -Pnative fails with an unknown arguments error
It seems to have to do with the args being passed with -J
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit GraalVM CE 19.3.0
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] C:\Users\george\scoop\apps\graalvm\current\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 rovert-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 rovert-1.0.0-SNAPSHOT-runner
Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"
Error: Unknown arguments: org.jboss.logmanager.LogManager, io.quarkus.vertx.core.runtime.VertxLogDelegateFactory, true, DISABLED, 1, com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime, 1, 0, http, rovert-1.0.0-SNAPSHOT-runner
Environment (please complete the following information):
-
Output of
uname -aorver: windows 10 -
Output of
java -version: openjdk version “11.0.5” 2019-10-15 OpenJDK Runtime Environment (build 11.0.5+10-jvmci-19.3-b05-LTS) OpenJDK 64-Bit GraalVM CE 19.3.0 (build 11.0.5+10-jvmci-19.3-b05-LTS, mixed mode, sharing) -
Quarkus version or git rev: 1.0.0.RC1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 42 (42 by maintainers)
Commits related to this issue
- Add documentation for building native on windows Now that compiling to native on windows is working properly add documentation on the steps required as discussed in #5675 — committed to gdoenlen/quarkus by gdoenlen 4 years ago
- Add documentation for building native on windows Now that compiling to native on windows is working properly add documentation on the steps required as discussed in #5675 — committed to gdoenlen/quarkus by gdoenlen 4 years ago
- Add documentation for building native on windows Now that compiling to native on windows is working properly add documentation on the steps required as discussed in #5675 — committed to gdoenlen/quarkus by gdoenlen 4 years ago
- Add documentation for building native on windows Now that compiling to native on windows is working properly add documentation on the steps required as discussed in #5675 — committed to gsmet/quarkus by gdoenlen 4 years ago
- Add documentation for building native on windows Now that compiling to native on windows is working properly add documentation on the steps required as discussed in #5675 — committed to viniciusfcf/quarkus-fork by gdoenlen 4 years ago
I’m not sure what you mean by this, but without running the bat file CL won’t be found to be executed. After manually adding CL onto my path both shells complain about not having the include path set properly for the compiler. I’m assuming vcvars does something that sets an environment variable for this and only in cmd does it actually stay around after the bat file is done.
AFTER putting CL on path:
The only way I’ve gotten a clean compile in powershell is to:
vcvars64.batLike I said, it works, it’s just not ideal and requires some documentation.
@gsmet @gdoenlen I don’t think this is an issue any more. Let’s close it. Windows Quarkus native app build works just fine for me.
@geoand I managed to get around to testing this this morning and it does work, but it’s not really in an ideal form atm.
Some things to note:
vcvars64.batquarkus.platform.artifact-idasquarkus-universe-bomand I had to switch this toquarkus-bomfor maven to find 1.3.0.CR2, I’m not sure if this is a bug with quarkus.io or if this is by design.I know the first two issues are probably upstream problems with either Graal or Microsoft themselves, but if you want to drive adoption it’s probably something that should be worked on. I think for now there needs to be some sort of documentation somewhere on how to do the above process for windows users (maybe in here somewhere https://quarkus.io/guides/maven-tooling).
Thanks for keeping this a priority guys!
Environment:
@famod you can already use GraalVM 20.0 with Quarkus. I propose you give it a go 😃
When I take the printed command
and wrap every parameter that contains a
=with"...=..."and execute it manually, the “Unknown arguments” error vanishes! (but I then hit https://github.com/oracle/graal/issues/1675 which shadows the real problem)It seems Quarkus should do this wrapping automatically, at least on Windows.
https://github.com/gdoenlen/rovert/tree/graal8