quarkus: Native image on windows fails "Windows AWT integration is not ready in native-image"

Describe the bug

When trying to build a native image with Quarkus 3.0 on windows, using the Tika extension, Quarkus fails with an error indicating

Caused by: java.lang.UnsupportedOperationException: Windows AWT integration is not ready in native-image and would result in java.lang.UnsatisfiedLinkError: no awt in java.library.path.
    at io.quarkus.deployment.pkg.steps.NativeImageBuildStep$NativeImageInvokerInfo$Builder.build(NativeImageBuildStep.java:924)
    at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:253)

Expected behavior

Expected behaviour is that native image compiles without any issue, as my application does not use AWT directly. Tika does use it however, but it seems to be a very small, limited portion of it.

Actual behavior

Native image fails with the following exception

[error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
    at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:286)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.UnsupportedOperationException: Windows AWT integration is not ready in native-image and would result in java.lang.UnsatisfiedLinkError: no awt in java.library.path.
    at io.quarkus.deployment.pkg.steps.NativeImageBuildStep$NativeImageInvokerInfo$Builder.build(NativeImageBuildStep.java:924)
    at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:253)
    ... 11 more

How to Reproduce?

I’ve created a very minimal repository that allows to reproduce the issue. https://github.com/pelletier197/quarkus-tika-reproduction

Note that the exact command equivalents do succeed on linux, they must be executed on windows. In case this helps

  System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900HK
    Memory: 16.05 GB / 31.68 GB

Output of uname -a or ver

Microsoft Windows [Version 10.0.22621.1555]

Output of java -version

openjdk version “17.0.7” 2023-04-18 OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

GraalVM version (if different from Java)

I am using Mandrel 22.3.2.0 - Java 17 version

Quarkus version or git rev

Quarkus 3.0.0.CR2 (latest) as well as Quarkus Tika 2.0.0

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.5.1.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Thanks for checking.

It seems like @Karm has already assigned himself the issue.