Skip to content

Instantly share code, notes, and snippets.

@santanuchakrabarti
Created July 25, 2025 16:12
Show Gist options
  • Save santanuchakrabarti/861d3045f8148e00d5e27296eff12fbf to your computer and use it in GitHub Desktop.
Save santanuchakrabarti/861d3045f8148e00d5e27296eff12fbf to your computer and use it in GitHub Desktop.
Build clojure-lsp from source code for Termux

πŸ› οΈ Build clojure-lsp from Source on Termux

This guide explains how to build the latest version of clojure-lsp in Termux, install it to your local bin directory, and make it accessible from anywhere.


βœ… Prerequisites

Make sure you have these installed in Termux:

pkg update
pkg install -y git openjdk-17 clojure

πŸ”½ 1. Clone the Latest clojure-lsp Source Code

cd ~
git clone https://github.com/clojure-lsp/clojure-lsp
cd clojure-lsp

πŸ› οΈ 2. Build the Prod CLI Binary

cd cli
clojure -T:build prod-cli

This generates a native binary clojure-lsp and a standalone .jar file in the cli/ directory.


πŸ“¦ 3. Copy the Binary to ~/.local/bin

mkdir -p ~/.local/bin
cp clojure-lsp ~/.local/bin/

🧩 4. Add ~/.local/bin to your $PATH

Edit your ~/.bashrc (or .zshrc if using zsh):

nano ~/.bashrc

Add this line at the end:

export PATH="$HOME/.local/bin:$PATH"

Save and reload your shell:

source ~/.bashrc

βœ… Verify

which clojure-lsp
clojure-lsp --version

You should see version output like:

clojure-lsp 2025.06.13-xx.xx.xx
clj-kondo 2025.06.05

πŸŽ‰ Done!

You now have the latest clojure-lsp built from source and accessible globally from Termux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment