{"record":{"id":"994da6f4469578f3","repo":"oraios/serena","slug":"the-nextflow-language-server-requires-jdk-17-but","errorCode":null,"errorMessage":"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.","messagePattern":"The Nextflow language server requires JDK 17\\+ but '(.+?)' is JDK (.+?) \\(java\\.home=(.+?)\\)\\. Install a newer JDK and update ls_specific_settings\\.nextflow\\.java_home or JAVA_HOME\\.","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/nextflow_language_server.py","lineNumber":174,"sourceCode":"                if os.path.exists(candidate):\n                    java_exe = candidate\n                else:\n                    log.warning(\"JAVA_HOME='%s' invalid (no '%s'), falling back to PATH.\", env_home, candidate)\n            if java_exe is None:\n                java_exe = shutil.which(\"java\")\n            if java_exe is None:\n                raise SolidLSPException(\n                    \"Could not locate a Java installation for the Nextflow language server. \"\n                    \"Set ls_specific_settings.nextflow.java_home, set the JAVA_HOME environment variable, \"\n                    f\"or ensure 'java' is on PATH. Required: JDK {MIN_JDK_VERSION}+.\"\n                )\n\n            # reuse JDTLS's JVM interrogation, which reports the real java.home even for stub launchers\n            from solidlsp.language_servers.eclipse_jdtls import EclipseJDTLS\n\n            java_home, major_version = EclipseJDTLS.DependencyProvider._inspect_java(java_exe)\n            if major_version < MIN_JDK_VERSION:\n                raise SolidLSPException(\n                    f\"The Nextflow language server requires JDK {MIN_JDK_VERSION}+ but '{java_exe}' is JDK {major_version} \"\n                    f\"(java.home={java_home}). Install a newer JDK and update ls_specific_settings.nextflow.java_home \"\n                    \"or JAVA_HOME.\"\n                )\n            log.info(\"Using JDK %d at %s for the Nextflow language server\", major_version, java_exe)\n            return java_exe\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the Nextflow Language Server.\n        \"\"\"\n        return {\n            \"capabilities\": {\n                \"textDocument\": {\n                    \"synchronization\": {\"dynamicRegistration\": True, \"didSave\": True},\n                    \"completion\": {\"dynamicRegistration\": True, \"completionItem\": {\"snippetSupport\": False}},\n                    \"hover\": {\"dynamicRegistration\": True, \"contentFormat\": [\"markdown\", \"plaintext\"]},\n                    \"definition\": {\"dynamicRegistration\": True, \"linkSupport\": True},","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/nextflow_language_server.py#L156-L192","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install JDK 17+ and update ls_specific_settings.nextflow.java_home or JAVA_HOME to point at it.","Update PATH so `java -version` reports 17 or higher before starting the server.","If a project needs an older JDK elsewhere, keep the newer JDK solely for this setting instead of changing the global default."],"exampleFix":"// before\nls_specific_settings.nextflow.java_home = \"/usr/lib/jvm/java-11-openjdk\"\n// after\nls_specific_settings.nextflow.java_home = \"/usr/lib/jvm/jdk-17\"","handlingStrategy":"validation","validationCode":"import re, subprocess\n\ndef java_major_version(java_exe=\"java\"):\n    out = subprocess.run([java_exe, \"-version\"], capture_output=True, text=True)\n    m = re.search(r'version \"(\\d+)', out.stderr)\n    return int(m.group(1)) if m else None\nassert (java_major_version() or 0) >= 17","typeGuard":null,"tryCatchPattern":"try:\n    server = NextflowLanguageServer(...)\nexcept SolidLSPException as e:\n    if \"requires JDK\" in str(e):\n        fix_jdk_install()  # install/point to JDK 17+\n    raise","preventionTips":["Check `java -version` reports 17+ in the target environment.","Keep the JDK used by this setting decoupled from legacy project JDKs.","Pin JDK 17+ in your Dockerfile/CI setup."],"tags":["java","version-incompatibility","nextflow","jdk"],"backgroundTag":"unsupported-jdk-version","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}