You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: REPL driven development of mixed Clojure / Java projects using Virgil
4
+
---
5
+
6
+
# Mixed Clojure / Java projects
7
+
8
+
## Mixed builds
9
+
Combined Java and Clojure projects where possible from the first day of Clojure.
10
+
The official Clojure documentation describes
11
+
[here](https://clojure.org/guides/tools_build#_mixed_java_clojure_build) such a
12
+
setup incl. a `build.clj`
13
+
14
+
For Leiningen we have a similar setup documented [here](https://github.com/technomancy/leiningen/blob/github/doc/MIXED_PROJECTS.md) .
15
+
16
+
## Java development in VSCode
17
+
VSCode has good [first class support](https://code.visualstudio.com/docs/languages/java) for Java.
18
+
19
+
So we have
20
+
21
+
* a "mixed build"
22
+
* comfortable editing of Clojure code with VSCode/Calva
23
+
* comfortable editing of Java source code with VSCode/Java extensions
24
+
25
+
but these do not address a REPL driven workflow spanning changing Clojure and Java files.
26
+
27
+
## Virgil
28
+
29
+
For quite a while, there was no real answer, as any change to a Java class required
30
+
the restart of the REPL, which is not a smooth workflow.
31
+
32
+
[Virgil](https://github.com/clj-commons/virgil) has changed this !
33
+
34
+
Virgil is a small Clojure library which continuously watches your java source files and recompiles them on each change and loads the changed classes into the running Clojure JVM.
35
+
36
+
This allows side-by-side development of Java and Clojure code and Virgil makes sure that the Clojure JVM gets the changed Java files injected.
0 commit comments