Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I recompile and reload Java source code while `lein repl` is running?

I have a Clojure project, and I'm using leiningen. I'm also using tools.namespace to reload Clojure code while running a REPL. If I want to include Java source in the project, can I recompile and reload it while the REPL is running? What is the most convenient/dynamic way of doing it? Can I do it so that it works well with tools.namespace?

like image 495
oskarkv Avatar asked Dec 09 '13 08:12

oskarkv


People also ask

How do I get out of Lein REPL?

You can exit the REPL by typing Ctrl+D (pressing the Ctrl and D keys at the same time).


2 Answers

I'm answering my own bounty here but I did do a bit of work getting this up:

Use Vinyasa,

and here is a blog post:

Dynamic reloading of java code in emacs/nrepl

... actually... it's kinda not working anymore... you have to do back to the earlier versions in order to get the support.

like image 98
zcaudate Avatar answered Oct 17 '22 03:10

zcaudate


Nowadays (2016->) the better answer is to use Virgil. It watches and recompiles all Java code in your leiningen project automatically in the background, as opposed to Vinyasa's approach of invoking reimport.

like image 6
Kalle Avatar answered Oct 17 '22 03:10

Kalle