{"record":{"id":"79b6ff4a7e7e570b","repo":"oraios/serena","slug":"both-jdtls-path-and-lombok-path-must-be-set-to","errorCode":null,"errorMessage":"Both 'jdtls_path' and 'lombok_path' must be set together in ls_specific_settings.java to use the upstream JDTLS mode. Set both, or remove both to use the default vscode-java VSIX mode.","messagePattern":"Both 'jdtls_path' and 'lombok_path' must be set together in ls_specific_settings\\.java to use the upstream JDTLS mode\\. Set both, or remove both to use the default vscode-java VSIX mode\\.","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/eclipse_jdtls.py","lineNumber":335,"sourceCode":"            \"\"\"\n            Setup runtime dependencies for EclipseJDTLS and return the paths.\n\n            Two modes are supported:\n\n            * **Upstream JDTLS mode** (activated when both ``jdtls_path`` and ``lombok_path`` are set\n              in ``ls_specific_settings.java``): uses an existing JDTLS installation (e.g. via\n              ``brew install jdtls`` or extracted ``jdt-language-server-*.tar.gz``) and the system JDK.\n              Nothing is downloaded by Serena. Suitable for restricted-network/corporate environments.\n            * **Default vscode-java VSIX mode** (activated otherwise): downloads the platform-specific\n              vscode-java VSIX bundle (containing JDTLS, bundled JRE 21 and Lombok) and a Gradle\n              distribution from public hosts.\n            \"\"\"\n            jdtls_path = custom_settings.get(\"jdtls_path\")\n            lombok_path = custom_settings.get(\"lombok_path\")\n            if jdtls_path or lombok_path:\n                # both must be set together to activate upstream mode\n                if not (jdtls_path and lombok_path):\n                    raise SolidLSPException(\n                        \"Both 'jdtls_path' and 'lombok_path' must be set together in \"\n                        \"ls_specific_settings.java to use the upstream JDTLS mode. \"\n                        \"Set both, or remove both to use the default vscode-java VSIX mode.\"\n                    )\n                return EclipseJDTLS.DependencyProvider._setup_from_existing_install(str(jdtls_path), str(lombok_path), custom_settings)\n\n            platformId = PlatformUtils.get_platform_id()\n            gradle_version = custom_settings.get(\"gradle_version\", cls.DEFAULT_GRADLE_VERSION)\n            vscode_java_version = custom_settings.get(\"vscode_java_version\", cls.DEFAULT_VSCODE_JAVA_VERSION)\n\n            # install-dir name per the version-pinning convention (see module-level block):\n            # INITIAL -> legacy unversioned dir; everything else -> \"{name}-{resolved}\" subdir\n            vscode_java_dirname = (\n                \"vscode-java\" if vscode_java_version == cls.INITIAL_VSCODE_JAVA_VERSION else f\"vscode-java-{vscode_java_version}\"\n            )\n\n            # Resolve internal VSIX paths (JRE / Lombok / launcher filenames). For pinned versions\n            # these are known; for any other user-supplied version we bail out — guessing would","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/eclipse_jdtls.py#L317-L353","documentation":"This SolidLSPException is raised during EclipseJDTLS setup when ls_specific_settings.java contains exactly one of 'jdtls_path' or 'lombok_path'. Upstream JDTLS mode requires both paths together (the server needs the lombok jar on its javaagent line), so a partial configuration is rejected with guidance to set both or neither.","triggerScenarios":"Creating an EclipseJDTLS language server (via _setup_runtime_dependencies, called from __init__) when custom_settings.get('jdtls_path') XOR custom_settings.get('lombok_path') is truthy under ls_specific_settings.java.","commonSituations":"User adds jdtls_path but forgets lombok_path (or vice versa); leftover key from a previous config edit; typo'd or renamed key so only one is picked up; example docs showing only one setting.","solutions":["Set BOTH 'jdtls_path' and 'lombok_path' in ls_specific_settings.java to enable upstream JDTLS mode.","Alternatively remove both keys to fall back to the default vscode-java VSIX mode.","Check for typos in the settings keys and ensure both entries are under ls_specific_settings.java.","Restart the session after correcting the configuration."],"exampleFix":"// before (invalid: only one key)\n{\"ls_specific_settings\": {\"java\": {\"jdtls_path\": \"/opt/jdtls\"}}}\n// after\n{\"ls_specific_settings\": {\"java\": {\"jdtls_path\": \"/opt/jdtls\", \"lombok_path\": \"~/.m2/repository/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar\"}}}","handlingStrategy":"validation","validationCode":"import os\njava = settings.get('ls_specific_settings', {}).get('java', {})\nkeys = ('jdtls_path', 'lombok_path')\npresent = [k for k in keys if java.get(k)]\nif len(present) == 1:\n    raise ValueError(f\"{present[0]} set but not the other; set both or neither\")","typeGuard":"def upstream_jdtls_config_complete(java_settings: dict) -> bool:\n    return bool(java_settings.get('jdtls_path')) == bool(java_settings.get('lombok_path')) and (\n        not java_settings.get('jdtls_path') or (\n            os.path.isdir(os.path.expanduser(java_settings['jdtls_path'])) and\n            os.path.isfile(os.path.expanduser(java_settings['lombok_path']))\n        )\n    )","tryCatchPattern":"try:\n    ls = SolidLSP(java_config)\nexcept SolidLSPException as e:\n    if \"must be set together\" in str(e):\n        java_config['ls_specific_settings']['java'].pop('jdtls_path', None)\n        java_config['ls_specific_settings']['java'].pop('lombok_path', None)\n        ls = SolidLSP(java_config)  # fall back to VSIX mode\n    else:\n        raise","preventionTips":["Always configure jdtls_path and lombok_path as a pair in ls_specific_settings.java.","Keep a checked-in settings template showing both keys together.","Validate settings files after edits with a small preflight script.","Prefer removing both keys (VSIX default mode) if you don't need upstream JDTLS."],"tags":["java","jdtls","configuration","validation"],"backgroundTag":"incomplete-configuration","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}