In the following blog post, I will show how to install La Clojure plugin, import project from leiningen to IntelliJ IDEA, how to interact with REPL and finally how to use IDEA's debugger to debug Clojure code run from REPL.
These features make Clojure development with IDEA a real pleasure.
Installation of La Clojure plugin
Importing leiningen projectWith the La Clojure plugin ready and active, we can import a leiningen project into IntelliJ IDEA. All we have to do is to generate appropriate Maven pom.xml file:
Then, we can import the maven module using IntelliJ IDEA.
Step 1: select Import Project from welcome screen:
Starting the REPL
Interacting with REPL
- Run selected text in REPL
- Execute last S-Expression in REPL
- Run top S-Expression in REPL
Debugging with REPL
Step 1: we have to create a Remote Debugger profile using Run / Edit Configurations... from a menu.
To add a Remote Debugger, we have to click on the plus '+' sign and select 'Remote' configuration type:
We can adjust the settings or leave them as default. Most importantly, we have to copy command line arguments for running remote JVM, for example: