This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-25
Channels
- # architecture (12)
- # asami (6)
- # aws (2)
- # babashka (2)
- # beginners (71)
- # bristol-clojurians (1)
- # calva (1)
- # cider (2)
- # clojure (136)
- # clojure-australia (6)
- # clojure-dev (14)
- # clojure-europe (11)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-sanfrancisco (29)
- # clojure-uk (9)
- # clojuredesign-podcast (12)
- # clojurescript (23)
- # code-reviews (7)
- # core-logic (5)
- # cryogen (7)
- # datomic (7)
- # depstar (7)
- # events (3)
- # fulcro (11)
- # helix (1)
- # jobs (2)
- # juxt (4)
- # kaocha (25)
- # leiningen (2)
- # malli (11)
- # off-topic (8)
- # pathom (1)
- # pedestal (9)
- # portkey (1)
- # reitit (3)
- # ring (2)
- # sci (46)
- # shadow-cljs (21)
- # tools-deps (15)
- # xtdb (31)
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)