Ran into some problems out of the gate:
java -jar c:\Users\[REDACTED]\.vscode\extensions\betterthantomorrow.calva-2.0.173-814-connect-without-project-7ab7b6e8\deps.clj.jar -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.25.8""}}}" -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Could not find C:\Users\[REDACTED]\.deps.clj\1.10.1.763\ClojureTools\clojure-tools-1.10.1.763.jar
Attempting download from <https://download.clojure.org/install/clojure-tools-1.10.1.763.zip>
Error building classpath. class java.lang.Character cannot be cast to class java.util.Map$Entry (java.lang.Character and java.util.Map$Entry are in module java.base of loader 'bootstrap')
java.lang.ClassCastException: class java.lang.Character cannot be cast to class java.util.Map$Entry (java.lang.Character and java.util.Map$Entry are in module java.base of loader 'bootstrap')
at clojure.core$key.invokeStatic(core.clj:1567)
at clojure.core$merge_with$merge_entry__5962.invoke(core.clj:3060)
at clojure.core$reduce1.invokeStatic(core.clj:944)
at clojure.core$merge_with$merge2__5964.invoke(core.clj:3066)
at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:63)
at clojure.core$reduce1.invokeStatic(core.clj:942)
at clojure.core$reduce1.invokeStatic(core.clj:934)
at clojure.core$merge_with.invokeStatic(core.clj:3059)
at clojure.core$merge_with.doInvoke(core.clj:3051)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:660)
at clojure.tools.deps.alpha$merge_edns.invokeStatic(alpha.clj:142)
at clojure.tools.deps.alpha$merge_edns.invoke(alpha.clj:139)
at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:78)
at clojure.tools.deps.alpha.script.make_classpath2$run_core.invoke(make_classpath2.clj:57)
at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:119)
at clojure.tools.deps.alpha.script.make_classpath2$run.invoke(make_classpath2.clj:113)
at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:169)
at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:140)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.main$main_opt.invokeStatic(main.clj:514)
at clojure.main$main_opt.invoke(main.clj:510)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Jack-in process exited. Status: 1
System configuration:
Version: 1.53.1 (user setup)
Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7
Date: 2021-02-08T23:29:42.785Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.21313
This was invoked using the "Fire up a 'Getting Started' REPL" in a new Code Window, so with a new workspace and no existing project.
Interesting. What's your JDK version?
❯ java -version
openjdk version "15.0.1" 2020-10-20
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.1+9, mixed mode, sharing)
This version of Calva is working in a workspace where I already have projects, so it's possible that it is brought on because it was a new workspace without predefined projects. Uncertain about that.
Thanks for helping out testing! It looks like the error @cb.lists ran into as well yesterday. Probably to do with that your username contains a space or two. I'm guessing your other projects are not using deps.edn, because this fails with the currently released Calva as well.
@pez, no space in my user name. 😕 But you are correct about not using deps.edn. The other projects I have right now are Lein based.
No spaces, huh? Not good. Then the problem is deeper. We have a long sad story with quoting the jack-in command line on Windows...
@pez, yeah, I think I ran into that trying to get Reveal to work. We eventually figured out the escaping which allowed me to modify jvm-opts for reveal, but it wasn't pleasant. This could be because you're using cmd.exe to launch? PowerShell is probably better for Windows users and your sanity anyway. VS Code suggests that it requires Windows 7. PowerShell 2 is integrated for Windows 7. So at a minimum, you should be able to rely on leveraging PowerShell to begin processes and it would likely https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows#escaping-quotes.
I’ve been using powershell and new powershell and everything. Always some Windows setup that doesn’t work. I thought I had nailed it this time, since it worked for all Windows testers.
The good part here is that I can reproduce the error on my VirtualBox Windows.
And I can still jack in to a deps.edn project, so it’s not clearcut a quoting problem…
Here’s an updated VSIX for ^that^, fixing the Windows issues on my VBox Windows at least. Please give it a spin friends! https://11429-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.173-814-connect-without-project-b7ecf926.vsix CC: @cb.lists @slack_clojurians
Welcome @sindre!
Much better. I was able to get the "Getting Started" REPL started without issue. To really get things started, the three .clj files should probably provide some guidance for evaluating the file. I'd recommend adding instructions for using Ctrl+Alt+C, Enter to evaluate the file in the REPL so that the new user can then evaluate each form. It would be useful for a new user if Alt+Enter would advance to the next top level form like I did with the MultiCommand Extension. Ideally it would probably step into each form in a comment, but that's just because it isn't as discoverable to someone unfamiliar with it. Lastly, the only example which unexpectedly doesn't work, after preparing the REPL for a namespace and stepping through each form, is the (def slurp-barf ...)
definition in hello_paredit.clj
.
; Syntax error compiling def at (c:\Users\[REDACTED]\AppData\Local\Temp\g31m79\hello_paredit.clj:64:1).
; Too many arguments to def
For introducing someone to Clojure, this is a very good experience. I have a slight concern that a reliance on deps.clj
will make it more difficult for someone to transition to running things outside Code, but other than a Java dependency, and I didn't see what would happen without Java installed, this is a very nice experience.
Thanks! I had added that load-file instruction to hello-clojure.clj, but should of course be added to hello-paredit as well. hello-repl is loaded by the “wizard”, perhaps unwisely, but I wanted to keep it super short. I don’t want to add more non-Calva behaviour so auto-advancing forms ain’t gonna happen 😃 . Good catch wih the slurp-barf form. Now fixed in my dev file. Thanks! I share the deps.clj concern, but it will have to be a sacrifice on the altar of Easy Start. Perhaps we can wet the appetite this way so that installing clojure tools will be something you gladly do to continue your journey. Java is required. There’s really nothing we can do about that until we make Calva work in Theia and therefore Gitpod. (I work on that now and then, but it is tiresome, so I escape from that work mostly.)