diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java index fc6c5dc3b64ba..64cba61df4d7a 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java @@ -139,8 +139,8 @@ public void contributeBootProperties(BiConsumer propertyCollecto public void onMetadataInitialized(Metadata metadata, BootstrapContext bootstrapContext, BiConsumer propertyCollector) { Version graalVMVersion = Version.getCurrent(); - boolean isGraalVM20OrBelow = !graalVMVersion.isSnapshot() // isSnapshot() will be true on OpenJDK - && graalVMVersion.compareTo(GRAAL_VM_VERSION_21) < 0; + final boolean isAOT = Boolean.getBoolean("com.oracle.graalvm.isaot"); + boolean isGraalVM20OrBelow = isAOT && graalVMVersion.compareTo(GRAAL_VM_VERSION_21) < 0; HibernateOrmIntegrationBooter booter = HibernateOrmIntegrationBooter.builder(metadata, bootstrapContext) .valueReadHandleFactory( // GraalVM 20 or below doesn't support method handles