This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-10
Channels
- # announcements (48)
- # asami (8)
- # babashka (186)
- # beginners (56)
- # calva (42)
- # clerk (84)
- # clj-kondo (75)
- # cljdoc (21)
- # clojure (121)
- # clojure-art (1)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-conj (2)
- # clojure-europe (10)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (2)
- # clojure-norway (9)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # clojurescript (11)
- # cursive (30)
- # datalevin (20)
- # datomic (4)
- # fulcro (5)
- # gratitude (1)
- # hyperfiddle (89)
- # introduce-yourself (1)
- # java (5)
- # jobs-discuss (8)
- # lsp (89)
- # malli (57)
- # membrane (16)
- # off-topic (12)
- # pathom (38)
- # releases (5)
- # shadow-cljs (17)
- # tools-deps (18)
- # xtdb (62)
I have an uberjar that runs fine on my mac, e.g.:
java -cp target/query.jar clojure.main -m aegp.main --help
works fine on my mac.
Relevant part of the deps.edn file is:
:uberdeps {
:replace-deps {uberdeps/uberdeps {:mvn/version "1.2.0"}}
:replace-paths []
:main-opts ["-m" "uberdeps.uberjar"]
}
all my *.clj source files have (:require [...] (:gen-class))
, yet a colleague running windows with only a JRE (not JDK) gets:
Error: Could not find or load main class clojure.main
though when he runs it from windows.
is there a better more robust manner to create the uberjar such that it can run on any of windows, macos, linux?That is exactly the error message you would expect if they tried that with a regular jar of your project, not an uberjar, so make sure they are using an uberjar
that error indicates the clojure.main class is not in the uber jar. if not, then your first command wouldn't work anywhere so something doesn't add up. you might check jar tf target/query.jar | grep clojure/main
cool, thanks. I'll check with him what he ran exactly. I'm also converting to a lein project to see if lein uberjar works as well..
If you can run it, but they cannot, the very likely explanation is they are running something different
could the version of java he is using be material? I am using 17, I think he is using java 8