Nevermind, I figured it out
This depends on your setup, java version, etc. I haven't been able to do that either, at least since I'm using JDK version > 8. Advice usually goes like adding java sources to your project explicitly. Here's one issue mentioning this problem: https://github.com/clojure-emacs/cider/issues/2269
What's the best way of configuring the java version per project? I have not found a way of setting environment variables with dir-locals
and cider has no variable which would translate to LEIN_JAVA_CMD
This was probably asked in the past but I was unable to find an answer online
@ben.sless I never thought of this actually, as I typically work on projects that target the same JDKs. Probably it'd be easiest to change the Emacs exec-path
in dir-locals.
You need eval
if you want to invoke some function in dir-locals
- https://emacs.stackexchange.com/questions/21955/calling-functions-in-dir-locals-in-emacs
huh, didn't occur to me to manipulate exec-path. I'll try and report results. Thanks 🙂
Do dir-locals
support something like
(cons "/usr/lib/jvm/java-14-openjdk-amd64/bin/" exec-path)
Its read literally 😞I fought with various different setups using jenv on Mac OS in the past but eventually gave up - now I'm using the most recent version (14) for all the projects
Well, I can just put this in a script and set it as a dir-local ((nil . ((cider-lein-command . "lein14"))))
cat lein14
#!/usr/bin/env sh
LEIN_JAVA_CMD=/usr/lib/jvm/java-14-openjdk-amd64/bin/java lein "$@"
Yeah, that would work.
Would someone with commit bit on piggieback have time to review this PR? https://github.com/nrepl/piggieback/pull/117 🙏
Currently when using a browser repl-env the logic to pprint evaluation results will error. This fixes that.
hello cider people, I have a strange error which shows up when I try to cljr jump to references to a function at point - it gives me the “this will take a long time” warning, then computes for a bit, then fails with an exception complaining about a bad keyword in a dev namsepace. The “cause” exception has the following message and first few lines:
Caused by: clojure.lang.ExceptionInfo: [line 149, col 32] Invalid keyword: ::streams/topology. {:type :reader-exception, :ex-kind :reader-error, :file "/Users/joni/Scratch/xapix/clojud/dev/src/dev.clj", :line 149, :col 32}
at refactor_nrepl.util$ex_info_assoc.invokeStatic(util.clj:27)
at refactor_nrepl.util$ex_info_assoc.doInvoke(util.clj:24)
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 refactor_nrepl.find.find_macros$find_macro_definitions_in_file.invokeStatic(find_macros.clj:51)
I can make a bug later if that’s required, but I figured I’d ask around first
It's on my todo list.
thank you ❤️
Sounds like you have a keyword in the dev.clj file that is invalid. Some clj-refactor commands require all the code to compile, so if there are bugs in the code they will fail.
well sure, but the keyword is valid - streams
is an alias for a required namespace. A few minutes later I was actually able to run the same command on a different symbol and it worked. That keyword is defined as an integrant key, if that’s relevant
the fact that it worked after a while, suggests to me that some code was not loaded prior to the first invocation, but was loaded before I ran it again.
hmm, I had some luck in the past disabling the pre-assembly of the AST, because of weird code loading issues and exceptions, as well as dynamic rebinds which caused errors - perhaps I’ll give that a shot next time I see this