oraios/serena · error · SolidLSPException

The Nextflow language server requires JDK 17+ but '{java_exe

Error message

The Nextflow language server requires JDK 17+ but '{java_exe}' is JDK {major_version} (java.home={java_home}). Install a newer JDK and update ls_specific_settings.nextflow.java_home or JAVA_HOME.

What it means

After locating a Java executable, _resolve_java interrogates the JVM via EclipseJDTLS.DependencyProvider._inspect_java to get the real java.home and major version. If the version is below MIN_JDK_VERSION (17), SolidLSPException is thrown because the Nextflow language server will not run on older JDKs.

Source

Thrown at src/solidlsp/language_servers/nextflow_language_server.py:174

                if os.path.exists(candidate):
                    java_exe = candidate
                else:
                    log.warning("JAVA_HOME='%s' invalid (no '%s'), falling back to PATH.", env_home, candidate)
            if java_exe is None:
                java_exe = shutil.which("java")
            if java_exe is None:
                raise SolidLSPException(
                    "Could not locate a Java installation for the Nextflow language server. "
                    "Set ls_specific_settings.nextflow.java_home, set the JAVA_HOME environment variable, "
                    f"or ensure 'java' is on PATH. Required: JDK {MIN_JDK_VERSION}+."
                )

            # reuse JDTLS's JVM interrogation, which reports the real java.home even for stub launchers
            from solidlsp.language_servers.eclipse_jdtls import EclipseJDTLS

            java_home, major_version = EclipseJDTLS.DependencyProvider._inspect_java(java_exe)
            if major_version < MIN_JDK_VERSION:
                raise SolidLSPException(
                    f"The Nextflow language server requires JDK {MIN_JDK_VERSION}+ but '{java_exe}' is JDK {major_version} "
                    f"(java.home={java_home}). Install a newer JDK and update ls_specific_settings.nextflow.java_home "
                    "or JAVA_HOME."
                )
            log.info("Using JDK %d at %s for the Nextflow language server", major_version, java_exe)
            return java_exe

    def _create_base_initialize_params(self) -> dict:
        """
        Returns the initialize params for the Nextflow Language Server.
        """
        return {
            "capabilities": {
                "textDocument": {
                    "synchronization": {"dynamicRegistration": True, "didSave": True},
                    "completion": {"dynamicRegistration": True, "completionItem": {"snippetSupport": False}},
                    "hover": {"dynamicRegistration": True, "contentFormat": ["markdown", "plaintext"]},
                    "definition": {"dynamicRegistration": True, "linkSupport": True},

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Install JDK 17+ and update ls_specific_settings.nextflow.java_home or JAVA_HOME to point at it.
  2. Update PATH so `java -version` reports 17 or higher before starting the server.
  3. If a project needs an older JDK elsewhere, keep the newer JDK solely for this setting instead of changing the global default.

Example fix

// before
ls_specific_settings.nextflow.java_home = "/usr/lib/jvm/java-11-openjdk"
// after
ls_specific_settings.nextflow.java_home = "/usr/lib/jvm/jdk-17"
Defensive patterns

Strategy: validation

Validate before calling

import re, subprocess

def java_major_version(java_exe="java"):
    out = subprocess.run([java_exe, "-version"], capture_output=True, text=True)
    m = re.search(r'version "(\d+)', out.stderr)
    return int(m.group(1)) if m else None
assert (java_major_version() or 0) >= 17

Try / catch

try:
    server = NextflowLanguageServer(...)
except SolidLSPException as e:
    if "requires JDK" in str(e):
        fix_jdk_install()  # install/point to JDK 17+
    raise

Prevention

When it happens

Trigger: Launching the Nextflow language server with any Java resolution (setting, JAVA_HOME, or PATH) whose major version is 8/11/etc. — even if bin/java exists and runs.

Common situations: System default Java still on JDK 8/11 (common on older Linux distros and macOS with legacy installs); JAVA_HOME pointing at an old corporate-standard JDK; PATH java resolving to a stub or wrapper for an old JVM.

Related errors


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