Hi Elastic team,
We are integrating Elasticsearch 8.19.23 into our product which ships with Azul Zulu JRE 17.0.21.1.
During startup, Elasticsearch fails with:
Error occurred during initialization of boot layer
java.lang.module.FindException:
Module jdk.attach not found, required by org.elasticsearch.entitlement
On inspecting elasticsearch-entitlement-8.19.23.jar, we found the following module requirements in its module-info:
requires jdk.attach;
requires jdk.jlink;
requires jdk.jdi;
We understand why jdk.attach is required. The Entitlements implementation uses the Attach API to load its instrumentation agent, which instruments sensitive JDK methods and enforces entitlement checks.
However, we would like to understand the rationale behind the other two dependencies.
-
jdk.jdi: What functionality in Elasticsearch Entitlements requires the Java Debug Interface? Is it needed during normal Elasticsearch runtime, or only for debugging or development?
-
jdk.jlink: Why does the Entitlements module require the Java runtime image builder? Is it used at runtime, or is this dependency only required during the build or packaging process?
-
Are these two modules genuinely required in the production runtime, or could their module requirements be changed to optional (
requires static) or otherwise removed?
Our objective is to ship a minimal Java runtime rather than the full JDK, without modifying Elasticsearch functionality or compromising its security enforcement.
Could someone from the Elasticsearch Core/Infra team clarify the purpose of these dependencies and whether all three modules are mandatory at runtime?
We would appreciate any pointers to the relevant source code or implementation details.
Thanks!