Could you please tell me how to install Clojure 1.11 alfa on Linux?
I installed the current stable version by installing apt install openjdk-11-jdk leiningen rlwrap and executing script linux-install-1.10.3.822.sh mentioned in Clojure - Getting Started
I found download for the 1.11 Alfa version in this repository but it’s just a JAR file. Could you please tell me what to do with it?
Clojure is “just” a dependency. If you’re using the Clojure CLI, you will generally have a deps.edn file and you can specify the Clojure version under the :deps key:
If you’re using Leiningen, you will generally have a project.clj file and you can specify the version of Clojure in there as [org.clojure/clojure "1.11.0-alpha1"] in the :dependencies vector.
I’ve just tried on AWS instance to install openjdk-11-jdk and leiningen and then just lein new app test123, edit project.clj and cd test123/ ; lein repl and I’m in Clojure 1.11.
Which means I don’t even need to install Clojure on headless machine. I do need it only on a machine with VSCode since other amaaaazing project Calva needs it.
I’ve just tried that and editing /usr/local/lib/clojure/deps.edn is not enough and you still get 1.10.3.
That has probably something to do with shell script /usr/local/bin/clojure and /usr/local/lib/clojure/libexec/clojure-tools-1.10.3.822.jar so I’m assuming I would have to hack that shell script and replace JAR file. But I don’t really need that as much. I’m happy to stick with lein repl and later switch to official 1.11.
You should not edit the root deps.edn or touch the clojure script.
There’s a user deps.edn file created the first time you run the clojure or clj command – ~/.clojure/deps.edn (or ~/.config/clojure/deps.edn on XDG systems) – where you can safely add your defaults. Or edit the deps.edn in your project folder (current directory).
Amongst other things, you’ll see my deps.edn file has aliases to run any version of Clojure, from the nightly “snapshot” build all the back to Clojure 1.0!