Fork me on GitHub
#depstar
<
2020-11-25
>
mynomoto19:11:55

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?

seancorfield19:11:17

If you built the JAR with --main-class project.core then java -jar should work.

seancorfield19:11:31

(and your project.core ns has (:gen-class))

mynomoto19:11:56

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.

seancorfield19:11:43

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).

seancorfield19:11:55

(otherwise, no difference)

mynomoto19:11:02

This is great, thanks!