{"record":{"id":"ceedf9acb3a16b2b","repo":"elastic/elasticsearch","slug":"config-ceedf9","errorCode":"CONFIG","errorMessage":"Invalid java installation (no jvm.dll found in %s\\jre\\bin\\server\\ or %s\\bin\\server\\\"). Exiting...","messagePattern":"Invalid java installation \\(no jvm\\.dll found in (.+?)\\\\jre\\\\bin\\\\server\\\\ or (.+?)\\\\bin\\\\server\\\\\"\\)\\. Exiting\\.\\.\\.","errorType":"error_code","errorClass":"UserException","httpStatus":null,"severity":"error","filePath":"distribution/tools/windows-service-cli/src/main/java/org/elasticsearch/windows/service/WindowsServiceInstallCommand.java","lineNumber":134,"sourceCode":"    private static String getJvmOptions(Map<String, String> sysprops) {\n        List<String> jvmOptions = new ArrayList<>();\n        jvmOptions.add(\"-XX:+UseSerialGC\");\n        // passthrough these properties\n        for (var prop : List.of(\"es.path.home\", \"es.path.conf\", \"es.distribution.type\")) {\n            jvmOptions.add(\"-D%s=%s\".formatted(prop, quote(sysprops.get(prop))));\n        }\n        return String.join(\";\", jvmOptions);\n    }\n\n    @Override\n    protected void preExecute(Terminal terminal, ProcessInfo pinfo, String serviceId) throws UserException {\n        Path javaHome = getJavaHome(pinfo.sysprops());\n        terminal.println(String.format(java.util.Locale.ROOT, \"Installing service : %s\", serviceId));\n        terminal.println(String.format(java.util.Locale.ROOT, \"Using ES_JAVA_HOME : %s\", javaHome.toString()));\n\n        Path javaDll = getJvmDll(javaHome);\n        if (Files.exists(javaDll) == false) {\n            throw new UserException(\n                ExitCodes.CONFIG,\n                \"Invalid java installation (no jvm.dll found in %s\\\\jre\\\\bin\\\\server\\\\ or %s\\\\bin\\\\server\\\"). Exiting...\".formatted(\n                    javaHome.toString(),\n                    javaHome.toString()\n                )\n            );\n        }\n\n        // validate username and password come together\n        boolean hasUsername = pinfo.envVars().containsKey(\"SERVICE_USERNAME\");\n        if (pinfo.envVars().containsKey(\"SERVICE_PASSWORD\") != hasUsername) {\n            throw new UserException(\n                ExitCodes.CONFIG,\n                \"Both service username and password must be set, only got \" + (hasUsername ? \"SERVICE_USERNAME\" : \"SERVICE_PASSWORD\")\n            );\n        }\n    }\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/distribution/tools/windows-service-cli/src/main/java/org/elasticsearch/windows/service/WindowsServiceInstallCommand.java#L116-L152","documentation":"Thrown by WindowsServiceInstallCommand.preExecute when ES_JAVA_HOME does not contain a server JVM shared library (jvm.dll) in either `<javaHome>\\jre\\bin\\server\\` (legacy JRE layout) or `<javaHome>\\bin\\server\\` (modern JDK layout). Procrun needs jvm.dll to host the JVM inside the service process, so its absence means the install cannot proceed. Exit code CONFIG marks this as an environment problem rather than a usage problem.","triggerScenarios":"ES_JAVA_HOME points at a JRE (no server JVM), at a JDK installed without the server JVM, at a Microsoft BuildTools JDK that lacks `server\\jvm.dll`, or at a path that is a symlink to the wrong place.","commonSituations":"Pointing ES_JAVA_HOME at `C:\\Program Files\\Java\\jre-*` instead of a JDK. Using a JDK that only ships the client JVM. Path typos or trailing slashes confusing resolution.","solutions":["Verify the dll exists: `dir \"%ES_JAVA_HOME%\\bin\\server\\jvm.dll\"`.","Install a full JDK (e.g. Eclipse Temurin JDK) that ships the server JVM.","Set ES_JAVA_HOME to the JDK root (the directory containing bin/, lib/, conf/).","If you must use a legacy JRE layout, ensure `<javaHome>\\jre\\bin\\server\\jvm.dll` exists."],"exampleFix":"REM before\nset ES_JAVA_HOME=C:\\Program Files\\Java\\jre-21\nbin\\elasticsearch-service.bat install\nREM after\nset ES_JAVA_HOME=C:\\Program Files\\Eclipse Adoptium\\jdk-21.0.5\nbin\\elasticsearch-service.bat install\ndir \"%ES_JAVA_HOME%\\bin\\server\\jvm.dll\"","handlingStrategy":"validation","validationCode":"Path javaHome = Paths.get(System.getenv(\"ES_JAVA_HOME\"));\nPath dll = javaHome.resolve(\"bin/server/jvm.dll\");\nif (!Files.isRegularFile(dll)) {\n    throw new IllegalStateException(\"No jvm.dll at \" + dll + \"; install a full JDK with the server JVM.\");\n}","typeGuard":"static boolean hasServerJvm(Path javaHome) {\n    return Files.isRegularFile(javaHome.resolve(\"bin/server/jvm.dll\"))\n        || Files.isRegularFile(javaHome.resolve(\"jre/bin/server/jvm.dll\"));\n}","tryCatchPattern":"try {\n    installCommand.preExecute(terminal, pinfo, serviceId);\n} catch (UserException e) {\n    if (e.exitCode == ExitCodes.CONFIG && e.getMessage().contains(\"jvm.dll\")) {\n        // direct operator to set ES_JAVA_HOME to a JDK that ships server/jvm.dll\n    } else throw e;\n}","preventionTips":["Point ES_JAVA_HOME at a JDK (not a JRE) that ships the server JVM, e.g. Eclipse Temurin.","Add a preflight `dir \"%ES_JAVA_HOME%\\bin\\server\\jvm.dll\"` to install scripts.","Avoid Microsoft BuildTools distributions which may omit the server JVM."],"tags":["windows","service","java-home","jvm","installation","configuration"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}