How to install Clojure v1.11 Alfa on Linux?

Hello Clojurists,

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?

Thank you.

Adam

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:

{:deps {org.clojure/clojure {:mvn/version "1.11.0-alpha1"}}}

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.

1 Like

Awesome! Thank you.

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.

Thank you @seancorfield :wink:

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.

Thx again :wink:

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).

@Adama As a follow-up on the user deps.edn file: take a look at my ~/.clojure/deps.edn file seancorfield/dot-clojure: My .clojure/deps.edn file (github.com) or, if you want a well-documented, well-maintained example with more verbose alias naming then there is practicalli/clojure-deps-edn: A collection of useful configuration and aliases for deps.edn based projects (github.com) (also linked from the README in my repo).

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!

Ouh, that was so much easier than hacking global file ;-). And it’s working. Thank you!

Awesome. Thank you.