{"record":{"id":"f36f912bd4eeda29","repo":"oraios/serena","slug":"config-directory-config-dir-not-found-this-jd","errorCode":null,"errorMessage":"Config directory '{config_dir}' not found. This JDTLS distribution does not support platform '{platform_id}'. Verify you downloaded the correct tar.gz for your OS/architecture.","messagePattern":"Config directory '(.+?)' not found\\. This JDTLS distribution does not support platform '(.+?)'\\. Verify you downloaded the correct tar\\.gz for your OS/architecture\\.","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/eclipse_jdtls.py","lineNumber":558,"sourceCode":"            return matches[-1]\n\n        @staticmethod\n        def _resolve_config_dir(jdtls_root: Path) -> Path:\n            \"\"\"\n            Locates the platform-specific OSGi configuration directory inside the JDTLS root.\n\n            :return: path to ``config_<platform>/`` directory matching the current OS/arch\n            \"\"\"\n            platform_id = PlatformUtils.get_platform_id().value\n            config_dir_name = JDTLS_CONFIG_DIR_BY_PLATFORM.get(platform_id)\n            if config_dir_name is None:\n                raise SolidLSPException(\n                    f\"Unsupported platform '{platform_id}' for upstream JDTLS mode. \"\n                    f\"Supported platforms: {sorted(set(JDTLS_CONFIG_DIR_BY_PLATFORM.values()))}.\"\n                )\n            config_dir = jdtls_root / config_dir_name\n            if not config_dir.is_dir():\n                raise SolidLSPException(\n                    f\"Config directory '{config_dir}' not found. \"\n                    f\"This JDTLS distribution does not support platform '{platform_id}'. \"\n                    f\"Verify you downloaded the correct tar.gz for your OS/architecture.\"\n                )\n            return config_dir\n\n        @staticmethod\n        def _resolve_system_jdk(custom_settings: SolidLSPSettings.CustomLSSettings) -> tuple[str, str]:\n            \"\"\"\n            Resolves the system-installed JDK home and ``java`` executable, validates the version.\n\n            The ``java`` executable is located by priority: ``java_home`` setting ->\n            ``JAVA_HOME`` env var -> ``java`` in PATH. The actual JDK home directory and\n            major version are then discovered by querying the JVM itself via\n            ``java -XshowSettings:properties -version`` — this is the single source of truth\n            and works correctly even when the locator is a system stub (e.g. ``/usr/bin/java``\n            on macOS, which delegates to ``/usr/libexec/java_home`` under the hood and does not\n            resolve to the real JDK home via simple path traversal).","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/eclipse_jdtls.py#L540-L576","documentation":"SolidLSPException thrown by _resolve_config_dir when the config/<platform> subdirectory does not exist inside the resolved JDTLS install root. JDTLS ships separate config dirs per OS/arch (e.g. config_linux, config_mac_arm); if the tar.gz was built for a different platform, the directory for the current platform_id is missing. This guards against launching JDTLS with a wrong or corrupt distribution.","triggerScenarios":"Calling _setup_from_existing_install with a jdtls_root that lacks the platform-specific config directory (config_dir_name derived from platform_id), e.g. pointing the existing-install path at a JDTLS tar.gz downloaded for a different OS/architecture, or an incomplete extraction.","commonSituations":"Downloading the linux x86_64 JDTLS tar.gz but running on mac arm64; copying only part of the extracted distribution; hardcoding a jdtls_root from another machine; CI cache restoring a mismatched artifact.","solutions":["Download the JDTLS tar.gz matching your OS/architecture and point jdtls_root at the extracted directory","Verify the directory <jdtls_root>/<config_dir_name> (e.g. config_linux) actually exists","Re-extract the archive fully; check it was not partially copied","If the platform is genuinely unsupported, use a JDTLS build that ships a config dir for it"],"exampleFix":"// before\njdtls_root = Path(\"/opt/jdt-language-server-latest\")  # wrong-arch tarball\n// after\njdtls_root = Path(\"/opt/jdt-language-server-1.40.0-202409261450\")  # matches linux x86_64; contains config_linux/","handlingStrategy":"validation","validationCode":"from pathlib import Path\ndef validate_jdtls_root(jdtls_root: str, config_dir_name: str) -> bool:\n    return (Path(jdtls_root) / config_dir_name).is_dir()","typeGuard":"def has_platform_config(jdtls_root: Path, config_dir_name: str) -> bool:\n    return jdtls_root.is_dir() and (jdtls_root / config_dir_name).is_dir()","tryCatchPattern":"from solidlsp import SolidLSPException\ntry:\n    ls = EclipseJDTLS._setup_from_existing_install(jdtls_root)\nexcept SolidLSPException as e:\n    if \"Config directory\" in str(e):\n        re_download_correct_tarball(platform_id)  # then retry\n    else:\n        raise","preventionTips":["Download the JDTLS tar.gz matching your exact OS/arch and keep it alongside the config dirs","Script the download so the correct platform artifact is fetched per-runner in CI","Verify the extracted tree contains config_* before pointing the library at it","Avoid hand-copying parts of the extracted distribution"],"tags":["jdtls","java","configuration","path-resolution"],"backgroundTag":"wrong-platform-distribution","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}