oraios/serena · error · SolidLSPException

Config directory ' ' not found. This JDTLS distribution…

Error message

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.

What it means

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.

Solutions

  1. Download the JDTLS tar.gz matching your OS/architecture and point jdtls_root at the extracted directory
  2. Verify the directory <jdtls_root>/<config_dir_name> (e.g. config_linux) actually exists
  3. Re-extract the archive fully; check it was not partially copied
  4. If the platform is genuinely unsupported, use a JDTLS build that ships a config dir for it

Example fix

// before
jdtls_root = Path("/opt/jdt-language-server-latest")  # wrong-arch tarball
// after
jdtls_root = Path("/opt/jdt-language-server-1.40.0-202409261450")  # matches linux x86_64; contains config_linux/
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
def validate_jdtls_root(jdtls_root: str, config_dir_name: str) -> bool:
    return (Path(jdtls_root) / config_dir_name).is_dir()

Type guard

def has_platform_config(jdtls_root: Path, config_dir_name: str) -> bool:
    return jdtls_root.is_dir() and (jdtls_root / config_dir_name).is_dir()

Try / catch

from solidlsp import SolidLSPException
try:
    ls = EclipseJDTLS._setup_from_existing_install(jdtls_root)
except SolidLSPException as e:
    if "Config directory" in str(e):
        re_download_correct_tarball(platform_id)  # then retry
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/f36f912bd4eeda29. Report an issue: GitHub.

Appendix: source

Thrown at src/solidlsp/language_servers/eclipse_jdtls.py:558

            return matches[-1]

        @staticmethod
        def _resolve_config_dir(jdtls_root: Path) -> Path:
            """
            Locates the platform-specific OSGi configuration directory inside the JDTLS root.

            :return: path to ``config_<platform>/`` directory matching the current OS/arch
            """
            platform_id = PlatformUtils.get_platform_id().value
            config_dir_name = JDTLS_CONFIG_DIR_BY_PLATFORM.get(platform_id)
            if config_dir_name is None:
                raise SolidLSPException(
                    f"Unsupported platform '{platform_id}' for upstream JDTLS mode. "
                    f"Supported platforms: {sorted(set(JDTLS_CONFIG_DIR_BY_PLATFORM.values()))}."
                )
            config_dir = jdtls_root / config_dir_name
            if not config_dir.is_dir():
                raise SolidLSPException(
                    f"Config directory '{config_dir}' not found. "
                    f"This JDTLS distribution does not support platform '{platform_id}'. "
                    f"Verify you downloaded the correct tar.gz for your OS/architecture."
                )
            return config_dir

        @staticmethod
        def _resolve_system_jdk(custom_settings: SolidLSPSettings.CustomLSSettings) -> tuple[str, str]:
            """
            Resolves the system-installed JDK home and ``java`` executable, validates the version.

            The ``java`` executable is located by priority: ``java_home`` setting ->
            ``JAVA_HOME`` env var -> ``java`` in PATH. The actual JDK home directory and
            major version are then discovered by querying the JVM itself via
            ``java -XshowSettings:properties -version`` — this is the single source of truth
            and works correctly even when the locator is a system stub (e.g. ``/usr/bin/java``
            on macOS, which delegates to ``/usr/libexec/java_home`` under the hood and does not
            resolve to the real JDK home via simple path traversal).

View on GitHub (pinned to 7fcbca7e62)