oraios/serena · error · RuntimeError

Groovy Language Server JAR not found. To use Groovy language

Error message

Groovy Language Server JAR not found. To use Groovy language support:
Set 'ls_jar_path' in groovy settings in serena_config.yml:
   ls_specific_settings:
     groovy:
       ls_jar_path: '/path/to/groovy-language-server.jar'
   Ensure the JAR file is available at the configured path

What it means

RuntimeError raised by GroovyLanguageServer._find_groovy_ls_jar (called from _setup_runtime_dependencies) when no Groovy Language Server JAR can be located. Unlike many servers, the Groovy LS is not auto-downloaded; it must be supplied via the ls_jar_path setting in serena_config.yml. This is a configuration-required error.

Source

Thrown at src/solidlsp/language_servers/groovy_language_server.py:236

        assert java_path and os.path.exists(java_path), f"Java executable not found at {java_path}"

        ls_jar_path = cls._find_groovy_ls_jar(solidlsp_settings)

        return GroovyRuntimeDependencyPaths(java_path=java_path, java_home_path=java_home_path, ls_jar_path=ls_jar_path)

    @classmethod
    def _find_groovy_ls_jar(cls, solidlsp_settings: SolidLSPSettings) -> str:
        """
        Find Groovy Language Server JAR file
        """
        if solidlsp_settings and solidlsp_settings.ls_specific_settings:
            groovy_settings = solidlsp_settings.get_ls_specific_settings(LanguageServerId.GROOVY)
            config_jar_path = groovy_settings.get("ls_jar_path")
            if config_jar_path and os.path.exists(config_jar_path):
                log.info(f"Using Groovy LS JAR from configuration: {config_jar_path}")
                return config_jar_path

        # if JAR not found
        raise RuntimeError(
            "Groovy Language Server JAR not found. To use Groovy language support:\n"
            "Set 'ls_jar_path' in groovy settings in serena_config.yml:\n"
            "   ls_specific_settings:\n"
            "     groovy:\n"
            "       ls_jar_path: '/path/to/groovy-language-server.jar'\n"
            "   Ensure the JAR file is available at the configured path\n"
        )

    def _create_base_initialize_params(self) -> dict:
        """
        Returns the initialize params for the Groovy Language Server.
        """
        initialize_params = {
            "capabilities": {
                "textDocument": {
                    "synchronization": {"dynamicRegistration": True, "didSave": True},
                    "completion": {"dynamicRegistration": True},

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Download/build the Groovy Language Server JAR (groovy-language-server project) to a stable location
  2. Set ls_specific_settings.groovy.ls_jar_path to the absolute path of the JAR in serena_config.yml
  3. Verify the file exists: ls -l /path/to/groovy-language-server.jar
  4. Use an absolute path, not relative, so it resolves regardless of working directory

Example fix

# before (serena_config.yml)
ls_specific_settings:
  groovy:
    ls_jar_path: 'groovy-language-server.jar'  # relative, not found
// after
ls_specific_settings:
  groovy:
    ls_jar_path: '/opt/tools/groovy-language-server.jar'  # absolute, exists
Defensive patterns

Strategy: validation

Validate before calling

import os, yaml
def ensure_groovy_jar_configured(config_path='serena_config.yml'):
    cfg = yaml.safe_load(open(config_path))
    jar = cfg.get('ls_specific_settings', {}).get('groovy', {}).get('ls_jar_path')
    if not jar or not os.path.isfile(jar):
        raise FileNotFoundError(f"Groovy LS JAR not set or missing: {jar}")

Try / catch

try:
    ls = GroovyLanguageServer(...)
except RuntimeError as e:
    if 'JAR not found' in str(e):
        log.error('Set ls_specific_settings.groovy.ls_jar_path to an absolute existing jar path')
        raise

Prevention

When it happens

Trigger: Initializing Groovy language support when ls_specific_settings.groovy.ls_jar_path is unset, or set but the file does not exist at that path (os.path.exists fails).

Common situations: Never configured the jar path; typo in the path or the jar was moved/deleted; configured a relative path while the process runs from a different working directory; forgot the ls_specific_settings.groovy nesting in serena_config.yml.

Related errors


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