Steps to reproduce the issue
file: /etc/sysconfig/elasticsearch
ES_JAVA_HOME=/usr/lib/jvm/java-17-openjdk
Expected result:
Plugins do not work on java version 17
java.lang.UnsupportedClassVersionError: org/elasticsearch/entitlement/runtime/policy/PolicyParser has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 61.0
there should be more context around this error:
``` java.lang.UnsupportedClassVersionError: org/elasticsearch/entitlement/runtime/policy/PolicyParser has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 61.0
```
I want to see it.
I guess it was a patching step, not the Elasticsearch runtime?
If it’s difficult for you to gather the context now, I will try to reproduce it on my end, obviously.
[2025-08-29T11:04:05,302][ERROR][o.e.b.Elasticsearch ] [host-client]fatal exception while booting Elasticsearch
java.lang.UnsupportedClassVersionError: org/elasticsearch/entitlement/runtime/policy/PolicyParser has been compiled by a more recent version of the Java Runtime (class file version 66.0), this version of the Java Runtime only recognizes class file versions up to 61.0
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
at java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?]
at java.lang.ClassLoader.defineClass(ClassLoader.java:1095) ~[?:?]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182) ~[?:?]
at jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821) ~[?:?]
at jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:741) ~[?:?]
at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:665) ~[?:?]
at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) ~[?:?]
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
at org.elasticsearch.entitlement.runtime.policy.PolicyUtils.parsePolicyIfExists(PolicyUtils.java:146) ~[elasticsearch-entitlement-8.18.3.jar:?]
at org.elasticsearch.entitlement.runtime.policy.PolicyUtils.createPluginPolicies(PolicyUtils.java:71) ~[elasticsearch-entitlement-8.18.3.jar:?]
at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:244) ~[elasticsearch-8.18.3.jar:?]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:96) ~[elasticsearch-8.18.3.jar:?]