Fork me on GitHub
#leiningen
<
2022-06-13
>
Marius13:06:16

Hey there! I have a mixed project with Clojure(Script) and Java, located in src/clj, src/cljs and src/java. Leiningen is configured with :java-source-paths ["src/java" "test/java"] . So far so good. When running lein javac, a ClassNotFound exception is thrown because the Clojure code is compiled first and fails to locate the Java .class. When I remove all references to Java from my Clojure code, I can run lein javac, and afterwards compile the (restored) Clojure code. Of course I’d like to avoid that step. Is there any way I can make Leiningen compile the Java code first (which is self-contained; does not have a reference to Clojure code)?

mikerod22:06:59

@mail990 have you tried adding the java source to the normal :source-paths

mikerod22:06:16

javac is a built-in :prep-tasks I believe.

mikerod22:06:41

I'd probably need to see your project.clj layout beyond that