Skip to content

Commit d67c5e5

Browse files
committed
Note that Clojure 1.12+ is required and print a readable error if it isn't
1 parent b17acb6 commit d67c5e5

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Add these aliases to your user `deps.edn`:
2626

2727
The server runs on the project classpath. The client runs in its own JVM with only its own deps.
2828

29-
**Note: Java 17+ is required**
29+
**Note: Java 17+ and Clojure 1.12+ are required**
3030

3131
## Run
3232

‎server/src/clojure_cli/repl/server.clj‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
(:require
33
[clojure.data.json :as json]
44
[clojure.edn :as edn]
5-
[clojure.java.doc.api :as jdoc]
65
[clojure.java.io :as io]
76
[clojure.java.shell :as sh]
87
[clojure.string :as str]
@@ -72,7 +71,7 @@
7271
(doc-block (str ns "/" name) arglists doc)))
7372

7473
(defn java-doc [sym]
75-
(try (with-out-str (jdoc/javadoc-fn (str sym) nil))
74+
(try (with-out-str ((requiring-resolve 'clojure.java.doc.api/javadoc-fn) (str sym) nil))
7675
(catch Exception _ nil)))
7776

7877
(defn doc-for [token ns-name]
@@ -203,7 +202,13 @@
203202
.inheritIO
204203
.start)))
205204

205+
(defn check-clojure-version []
206+
(when (< (:minor *clojure-version*) 12)
207+
(println "clojure-cli.repl requires Clojure 1.12 or later, started with" (clojure-version))
208+
(System/exit 1)))
209+
206210
(defn -main [& args]
211+
(check-clojure-version)
207212
(let [srv (start (load-config 'org.clojure/clojure-cli.repl))]
208213
(.addShutdownHook (Runtime/getRuntime)
209214
(Thread. ^Runnable (fn [] (stop srv)))) ;; on shutdown remove .nrepl-port

0 commit comments

Comments
 (0)