quarkusio / registry.quarkus.io

Quarkus Extension Registry application
https://registry.quarkus.io
Apache License 2.0
10 stars 11 forks source link

Quarkus Registry is not compatible with Native Image master and JDK 21 #240

Closed d-kozak closed 9 months ago

d-kozak commented 9 months ago

We use Quarkus Registry as a benchmark in some of our research papers focusing on static analysis in Native Image, because as far as I know, it is a fine example of a bigger Quarkus application (If you know of something even better, please let me know).

Unfortunately, Quarkus Registry is not compatible with JDK 21 and the master branch of https://github.com/oracle/graal. More precisely, it fails with:

Error: Return type mismatch:
    public static java.awt.Graphics io.quarkus.runtime.graal.Target_java_awt_GraphicsEnvironment.getLocalGraphicsEnvironment()
    public static java.awt.GraphicsEnvironment java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment()
com.oracle.svm.core.util.UserError$UserException: Return type mismatch:
    public static java.awt.Graphics io.quarkus.runtime.graal.Target_java_awt_GraphicsEnvironment.getLocalGraphicsEnvironment()
    public static java.awt.GraphicsEnvironment java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment()

which is caused by the fact that given method in JDK changed the return type in between versions.

I've managed to hack my way around it and a few follow-up problems that show up once this one is resolved and as of this morning I managed to compile Quarkus Registry with our master and JDK 21. However, it would be better for the research evaluation if the project worked out of the box without the tweaks. Are there any plans of updating Quarkus Registry in near future?

gastaldi commented 9 months ago

@d-kozak it should work with JDK 21 if you build it with Quarkus 3.7.2:

mvn clean package -Dnative -Dquarkus.version=3.7.2 -Dquarkus.groupId=io.quarkus.platform
d-kozak commented 9 months ago

Perfect, I confirm that it works without any tweaks (though I had to use your original suggestion editing pom.xml, using command line parameters did not work for some reason). Thank you for your quick response!