{"record":{"id":"07f03d6b0e3e1269","repo":"oraios/serena","slug":"clojure-not-found-please-install-the-official-c","errorCode":null,"errorMessage":"`clojure` not found.\nPlease install the official Clojure CLI from:\n  https://clojure.org/guides/getting_started","messagePattern":"`clojure` not found\\.\nPlease install the official Clojure CLI from:\n  https://clojure\\.org/guides/getting_started","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/clojure_lsp.py","lineNumber":74,"sourceCode":"    \"objects.githubusercontent.com\",\n)\n\n\ndef run_command(cmd: list, capture_output: bool = True) -> subprocess.CompletedProcess:\n    return subprocess_run(\n        cmd,\n        capture_output=False,\n        stdout=subprocess.PIPE if capture_output else None,\n        stderr=subprocess.STDOUT if capture_output else None,\n        text=True,\n        check=True,\n    )\n\n\ndef verify_clojure_cli() -> None:\n    install_msg = \"Please install the official Clojure CLI from:\\n  https://clojure.org/guides/getting_started\"\n    if shutil.which(\"clojure\") is None:\n        raise FileNotFoundError(\"`clojure` not found.\\n\" + install_msg)\n\n    help_proc = run_command([\"clojure\", \"--help\"])\n    if \"-Aaliases\" not in help_proc.stdout:\n        raise RuntimeError(\"Detected a Clojure executable, but it does not support '-Aaliases'.\\n\" + install_msg)\n\n    spath_proc = run_command([\"clojure\", \"-Spath\"], capture_output=False)\n    if spath_proc.returncode != 0:\n        raise RuntimeError(\"`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1.10.\")\n\n\nclass ClojureLSP(SolidLanguageServer):\n    \"\"\"\n    Provides a clojure-lsp specific instantiation of the LanguageServer class.\n\n    You can pass the following entries in ``ls_specific_settings[\"clojure\"]``:\n        - clojure_lsp_version: Override the pinned clojure-lsp version downloaded\n          by Serena (default: the bundled Serena version).\n        - source_paths: Explicit list of source paths (repo-root-relative) to","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/clojure_lsp.py#L56-L92","documentation":"verify_clojure_cli raises FileNotFoundError when the `clojure` executable (the official Clojure CLI) is not found on PATH. clojure-lsp startup requires the Clojure CLI to compute classpaths, so the library validates its presence before launching the server.","triggerScenarios":"Calling verify_clojure_cli (from _get_or_install_core_dependency or _test_clojure_cli) during clojure-lsp startup when shutil.which('clojure') returns None.","commonSituations":"Clojure CLI never installed (only Leiningen installed, which provides `lein` but not `clojure`); CLI installed via a tool manager (e.g. deps-edn install script) whose path is not on the server process's PATH; minimal Docker image without the CLI; PATH differs between IDE and shell.","solutions":["Install the official Clojure CLI per https://clojure.org/guides/getting_started (e.g. brew install clojure/cli/clojure or the Linux install script)","Ensure the install location (e.g. ~/.clojure/bin or /usr/local/bin) is on PATH for the process launching the server","Verify with `which clojure && clojure --help`; note Leiningen does not satisfy this requirement"],"exampleFix":"// before\n# only lein installed -> FileNotFoundError: `clojure` not found\n// after\ncurl -L https://download.clojure.org/install/linux-install.sh | sudo bash\nclojure --version","handlingStrategy":"validation","validationCode":"import shutil\nassert shutil.which(\"clojure\"), \"Install the official Clojure CLI (https://clojure.org/guides/getting_started); Leiningen does not count\"","typeGuard":null,"tryCatchPattern":"try:\n    server = ClojureLSP(...)\nexcept FileNotFoundError as e:\n    if \"`clojure` not found\" in str(e):\n        raise SystemExit(\"Install the official Clojure CLI and ensure it is on PATH, then retry\")\n    raise","preventionTips":["Install the official Clojure CLI, not just Leiningen","Add the CLI install dir (e.g. ~/.clojure/bin) to PATH in containers and IDE-spawned shells","Run `which clojure && clojure --version` before starting clojure-lsp"],"tags":["clojure","path","installation","dependency-missing"],"backgroundTag":"required-executable-not-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}