And I'm happy to say that I have an aot uberjar now. I tried and it keep working using java -cp MyProject.jar clojure.main -m project.core
. Is it ok to run this way instead of java -jar MyProject.jar
?
If you built the JAR with --main-class project.core
then java -jar
should work.
(and your project.core
ns has (:gen-class)
)
Yeah, both work in my tests. I'm wondering if there is a problem using java -cp MyProject.jar clojure.main -m project.core
with the aot uberjar.
The difference between the two invocations is that java -cp ...
will run clojure.main/-main
and that will parse the command-line args and then invoke project.core/-main
(as a regular Clojure function), whereas java -jar
will invoke project.core/-main
directly (as a Java static method).
(otherwise, no difference)
This is great, thanks!