2
votes

I'm pretty new to clojure development and I'm trying to work on some existing projects in emacs. The problem is, none of them have a project.clj file and I can't get an proper repl going. When I cider-jack-in, I get a working repl, but when I try to run any commands (C-c C-k/C-x C-e/etc) I get an error saying Could not locate lang__init.class or lang.clj on classpath. Are there any resources about how to make a clojure maven project to work with a lein repl?

Thanks.

EDIT: Additionally the project I'm working on is a nested project with multiple sub-projects with their own pom.xml. Any help on how such projects should be laid our to work with leiningen?

1
You can start an nrepl using Maven and connect from Emacs with cider-connect. Or maybe you can can convert a Maven project's pom.xml to a Leiningen project.clj with github.com/thickey/lein-nevam. - Erwin Rooijakkers
I did try maven nrepl with cider-connect, but for some reason it tells me that I don't have the correct version for cider-nrepl, which I can't figure out how to fix, and I can't compile/execute/etc and also I can't use the M-./M-, for symbol lookup. - marauder7
You might need to change the version of cider-nrepl in your ~/.lein/profiles.clj. - Erwin Rooijakkers
Tried that. Changed it to the latest available but doesn't seem to change anything. - marauder7

1 Answers

1
votes

You could also try a similar approach with Clojure Boot, a interesting alternative to Leiningen. Someone has made a with-pom task for Boot: https://libraries.io/github/cpmcdaniel/boot-with-pom.

Among the cool things about the Boot repl is their classloader allows you to dynamically add dependencies to the session jvm via (set-env!) without restart.