{"record":{"id":"4fb6176a06fdbae4","repo":"oracle/graal","slug":"cannot-find-include-folder-in-jdk-4fb617","errorCode":null,"errorMessage":"Cannot find 'include' folder in JDK.","messagePattern":"Cannot find 'include' folder in JDK\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdk/src/org.graalvm.jniutils/src/org/graalvm/jniutils/JNI.java","lineNumber":1121,"sourceCode":"        }\n\n        @Override\n        public List<String> getHeaderFiles() {\n            return Arrays.stream(findJNIHeaders()).map((p) -> '<' + p.toString() + '>').collect(Collectors.toList());\n        }\n\n        private static Path[] findJNIHeaders() {\n            Path javaHome = Paths.get(System.getProperty(\"java.home\"));\n            Path includeFolder = javaHome.resolve(\"include\");\n            if (!Files.exists(includeFolder)) {\n                Path parent = javaHome.getParent();\n                if (parent != null) {\n                    javaHome = parent;\n                }\n            }\n            includeFolder = javaHome.resolve(\"include\");\n            if (!Files.exists(includeFolder)) {\n                throw new IllegalStateException(\"Cannot find 'include' folder in JDK.\");\n            }\n            Path[] res = new Path[INCLUDES.length];\n            try {\n                for (int i = 0; i < INCLUDES.length; i++) {\n                    String include = INCLUDES[i];\n                    Optional<Path> includeFile = Files.find(includeFolder, 2, (p, attrs) -> include.equals(p.getFileName().toString())).findFirst();\n                    if (!includeFile.isPresent()) {\n                        throw new IllegalStateException(\"Include: \" + res[i] + \" does not exist.\");\n                    }\n                    res[i] = includeFile.get();\n                }\n                return res;\n            } catch (IOException ioe) {\n                throw new RuntimeException(ioe);\n            }\n        }\n    }\n}","sourceCodeStart":1103,"sourceCodeEnd":1139,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/src/org.graalvm.jniutils/src/org/graalvm/jniutils/JNI.java#L1103-L1139","documentation":"Error \"Cannot find 'include' folder in JDK.\" thrown in oracle/graal.","triggerScenarios":"Thrown at sdk/src/org.graalvm.jniutils/src/org/graalvm/jniutils/JNI.java:1121 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Cannot find 'include' folder in JDK.","solutions":["Fix the condition reported by the error: Cannot find 'include' folder in JDK.","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Cannot find 'include' folder in JDK.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}