Datomic free 0.9.5703.21 was tested on clojure 1.10.3 and openjdk 17 but failed below,
$ bin/maven-install
$ bin/transactor config/samples/free-transactor-template.properties
=> System started datomic:free://localhost:4334/<DB-NAME>
$ clj -Sdeps '{:deps {com.datomic/datomic-free {:mvn/version "0.9.5703.21"}}}'
user=> (require '[datomic.api :as d])
nil
user=> (d/create-database "datomic:free://localhost:4334/test")
Execution error (ActiveMQInternalErrorException) (ChannelImpl.java 404)
No error occurs if we just downgrade to openjdk 8. How to make it cope with openjdk 17?
Related
(ns secretary.core)
(defn -main
[& args]
(println args "Hello, World!"))
lein run 1 2 3
(1 2 3) Hello, World!
But I want it keep in REPL. Not exit.
Try this:
(ns demo.core )
(defn -main
[& args]
(println "Got:" args ))
with the above code:
> lein repl
Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Compiling 2 source files to /home/alan/expr/demo/target/default/class-files
nREPL server started on port 46184 on host 127.0.0.1 - nrepl://127.0.0.1:46184
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.1
Java HotSpot(TM) 64-Bit Server VM 13+33
demo.core=> (ns demo.core)
nil
demo.core=> (-main 1 2 3)
Got: (1 2 3)
demo.core=> (+ 3 4)
7
demo.core=>
So, you start the REPL first, then call a function (even -main). You are still in the REPL when finished.
P.S. Although, my personal favorite, is to use the lein test-refresh
plugin and write your experiments in unit-test style using your favorite editor.
I am trying to execute this piece of code:
(rest (file-seq (file (str "corpus/" "ham"))))
I want to get all files from "corpus/ham" directory, but I am getting this error: "error in process filter: stack overflow in regexp matcher".
Works for me:
(ns tst.demo.core
(:require [clojure.java.io :as io]))
with result:
-------------------------------------
Clojure 1.8.0 Java 1.8.0_161
-------------------------------------
(rest (file-seq (io/file (str "test/" "clj")))) =>
(#object[java.io.File 0x71c8e40e "test/clj/tst"]
#object[java.io.File 0x65a44d8a "test/clj/tst/demo"]
#object[java.io.File 0x7c3ccb39 "test/clj/tst/demo/core.clj"])
What is your environment? OS, clj & java version, etc? It also works on
Clojure 1.10.0 Java 11
I have tried the same on macOS, IntelijIdea community, Java 1.8 and Clojure 1.9
I see files present directory.
How do I start an nREPL from the clj command?
I can't run my project using Lein or Boot because I have an unbalanced paren somewhere, and the reader complains `java.lang.RuntimeException: read-cond starting on line 13 requires an even number of forms.
Things are easier now than they were when the question was posted:
$ clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.5.3"}}}' -m nrepl.cmdline
More details here.
Wrote a gist on how to do this:
clj -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.12"}}}'
Clojure 1.9.0
user=> (use '[clojure.tools.nrepl.server :only (start-server stop-server)])
nil
user=> (defonce server (start-server :port 7888))
#'user/server
Now you can connect to port 7888 using your remote REPL client. There is probably a way to do this in one line.
Does anyone know why I'm getting the below error? I read through answers of similar questions, which recommended using Leiningen, which I've done below and still get the error.
MacBook-Pro:~ xxx$ lein new app test
Generating a project called test based on the 'app' template.
MacBook-Pro:~ xxx$ cd test
MacBook-Pro:test xxx$ lein repl
nREPL server started on port 59623 on host 127.0.0.1
REPL-y 0.2.1
Clojure 1.5.1
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
test.core=> (require '[clojure.core.async :as async :refer :all])
**FileNotFoundException Could not locate clojure/core/async__init.class or clojure/core/async.clj on
classpath: clojure.lang.RT.load (RT.java:443)**
test.core=>
I also tried via cider repl in emacs:
; CIDER 0.3.1 (Clojure 1.5.1, nREPL 0.2.3)
user> (require '[clojure.core.async :as async :refer :all])
FileNotFoundException Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath: clojure.lang.RT.load (RT.java:443)
user>
You need to add it to your project.clj file. See the README for details for the current version. Once you make the necessary changes to project.clj, you need to restart the repl.
Today I noticed something odd. When I'm not "in" a project (that is, the shell is not in a clojure project's directory), I can use exit to exit the REPL:
shell$ lein repl
REPL started; server listening on localhost port 43712
user=> (+ 3 4)
7
user=> (exit)
shell$ echo '<span>not in <s>kansas</s>clojure anymore</span>'
When I'm "in" a project (that is, the shell is in a clojure project's directory), I can't use exit:
shell$ cd my_clojure_project
shell$ lein repl
REPL started; server listening on localhost port 69237
user=> (* 8 4)
32
user=> (exit)
java.lang.Exception: Unable to resolve symbol: exit in this context (NO_SOURCE_FILE:2)
user=>
What is the issue here?
Clojure version (for both examples):
user=> (clojure-version)
"1.2.1"
Leiningen version (for both examples):
shell$ lein -v
Leiningen 1.6.1 on Java 1.6.0_26 Java HotSpot(TM) 64-Bit Server VM
It appears to be because the leiningen.core namespace isn't available when there is a project. More specifically, when there is a project, your project's code is evaluated in a separate ClassLoader with only your project on the classpath. Therefore none of Leiningen's functions are available.
The Leiningen 2 REPL doesn't have this problem.