Fork me on GitHub
#cider
<
2020-11-30
>
Tim Robinson17:11:46

Hi all, I'm a complete newbie to clojure and cider and I'm trying to get it going on windows 10. All I've done so far is created a ~/.lein/profiles.clj file with the line {:user {:plugins [[cider/cider-nrepl "0.25.5"]]}} . (note: I haven't actually downloaded or installed anything - does leingen do this for me automatically?) Now when I start the repl with lein start repl I get hundreds of java exceptions like this:

java.lang.NullPointerException: Cannot invoke "jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.getOptions()" because "this.configuration" is null
        at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.getSupportedOptions(HtmlDoclet.java:292)
... (long stack trace)
The repl still starts and I can use it from the command line but it doesn't work from vim fireplace. I'm trying to figure out whether these messages mean that cider isn't running, or whether they are just spurious and the error is somewhere in my vim/fireplace configuration.

practicalli_john18:11:41

@tim.j.robinson my guess is the errors are from your project code lein new app myapp will create a simple Clojure project and lein repl should start a REPL when run from the root of that project. You only need a ~/.lein/profiles.clj file if using cider-connect from Emacs. If you use cider-jack-in-clj then you do not need the ~/.lein/profiles.clj file and should delete it.

practicalli_john18:11:45

If you cant start a REPL on the command line, then it wont start from anywhere elese. So its always a good first step. There is also a #vim channel for specific help with Vim. If you are just starting, you may find this free book helpful https://practicalli.github.io/clojure/ which uses the newer Clojure CLI tools rather than Leiningen.

dpsutton18:11:10

What’s your jvm version? I think I’ve heard there’s been a change in that doclets stuff

dpsutton18:11:23

Also if you’re using vim do you even need cider-nrepl at all? I thought that was just nrepl based

Tim Robinson18:11:42

I'm using the latest JVM - 15.0.1. When I searched for that error message there seem to be other reports of the same error (e.g. in calva and orchard) and they seem to be related to recent JVM versions so I guess that's the cause of the problem. What I'm not sure about is whether that error is fatal for cider or just a warning, because the repl itself still seems to work anyway thanks for the hints about not needing it at all. I've deleted the profiles.clj file and now I can connect to the nrepl OK from vim 🙂 According to the fireplace documentation this means "only a subset of the functionality will be available" but I can try to figure that out with the vim channel

dpsutton18:11:42

Ah ok. I wasn’t sure if that used the extra functionality. If it were me I’d drop back to a jdk 13 and go with cider nrepl

dpsutton18:11:42

I forgot what the warnings are related to. It’s something dumb about options being moved for the Java parser but it’s a minor part (I think. It’s been a bit since I’ve seen the issue)

Tim Robinson19:11:26

Thanks I'll try that tomorrow. great to be up and running though 🙂

Kira McLean21:11:43

Cider is no longer picking up the cider-clojure-cli-global-options from my .dir-locals.el file when I run cider-jack-in-clj..it seemed to work fine until today. What’s the best way to go about debugging that? I did recently upgrade some things but I’m not really sure where to start investigating to figure out which one broke this 😬

dpsutton21:11:49

seems unchanged since 2018: https://github.com/clojure-emacs/cider/blob/master/cider.el#L360-L361 an easy thing to check is if the dir local value is getting picked up. i always do M-: cider-clojure-cli-global-options or m-x describe-variable [ret] and then that variable.

Kira McLean21:11:16

yeah it’s really strange.. I have no idea why it just stopped working today! Looks like they’re not being loaded, cider-clojure-cli-global-options is nil.. that’s not what I want to see. Might be something wrong with my config or something. That’s a good thread to pull on, at least.. thanks for the tip!

dpsutton21:11:45

sure! you can try (hack-local-variables) to kinda poke it and make it look for the dir locals

dpsutton21:11:04

also, i've seen people leave off the leading . in the name but from above it looks like you've got that

Kira McLean22:11:39

very strange.. I made some changes to my config to start using org-roam over the weekend and just undid them all and now it seems to picking up .dir-locals.el again.. I’ll have to put the changes back one at a time I guess to try to figure out why. Configuring emacs is total black magic to me.

dpsutton22:11:29

Weird. I’ve never heard of a way to impact dir locals. I’m interested to hear what you find

Kira McLean22:11:37

hah.. I’ll be impressed if I ever narrow it down to one specific thing. I don’t understand what could have happened.