In order for lein to properly set up your classpath, it must be started inside the project directory. Change directory into the my-project directory before starting lein repl.
Can't evaluate Clojure web project code using Vim and tpope's Fireplace plugin?
-
12-07-2023 - |
Question
I've installed the Leiningen Clojure project tool using: brew install leiningen
(the REPL works fine).
I wanted to use Vim to write some Clojure code and so I've installed the following plugins:
- https://github.com/tpope/vim-fireplace/
- https://github.com/tpope/vim-classpath
- https://github.com/tpope/vim-clojure-static/
- https://github.com/vim-scripts/paredit.vim
- https://github.com/kien/rainbow_parentheses.vim
I opened three terminal consoles and execute commands in this order:
lein new compojure my-project
lein repl
cd my-project && vim
Within Vim I first connect to the REPL...
:Connect nrepl://127.0.0.1:60356
...then I open the my-project/src/my_project/handler.clj
file and press cpp
(which I think is aliased to :Eval
whilst my cursor is on the first character of the first opening parenthesis.
At this point I get the following error:
FileNotFoundException Could not locate my_project/handler__init.class or my_project/handler.clj on classpath: clojure.lang.RT.load (RT.java:443)
I've not been able to find any appropriate solutions?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow