What techniques that people have found useful using Clojure, Scala, JRuby, build tools, etc. to retrofit a Java project with a REPL to quickly experiment?
I often need to work with plain old Java projects (POJO projects?) and miss having a REPL. Other SO questions address this topic, but these are several years old and the responses are dated.
I’ll start by contributing a few techniques that I’ve used to solve this problem.
If the project uses Maven, the gmaven plugin and accompanying
mvn groovy:shellis helpful, although getting it configured correctly can be challenging.For those projects not using Maven, a common pattern is to include dependencies in a lib folder and manage them manually. For these, I’ve used groovy:
…or clojure:
The default Clojure wrapper can also be enhanced with rlwrap.