This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-31
Channels
- # aws (18)
- # babashka (35)
- # beginners (7)
- # cider (3)
- # clara (2)
- # clj-kondo (15)
- # cljs-dev (1)
- # cljsrn (3)
- # clojure (20)
- # clojure-canada (1)
- # clojure-dev (3)
- # clojure-spec (17)
- # clojure-uk (13)
- # clojutre (1)
- # cursive (7)
- # datomic (1)
- # duct (7)
- # fulcro (33)
- # helix (77)
- # jobs (3)
- # malli (15)
- # meander (3)
- # off-topic (30)
- # pathom (3)
- # quil (1)
- # reagent (1)
- # reitit (10)
- # shadow-cljs (2)
- # tools-deps (5)
- # xtdb (6)
- # yada (1)
Let me know if this is not the right place for this question.
I'm trying to build an uberjar with depstar
. It's my (almost) first attempt to do something like that.
Going by this snippet from the README:
# generate pom.xml (or create it manually)
clojure -Spom
# build the uberjar with AOT compilation
clojure -A:depstar -m hf.depstar.uberjar MyProject.jar -C -m project.core
# Main-Class: project.core
java -jar MyProject.jar
Did all that in a very simple "hello world" project.
Running that gives me
Error: Could not find or load main class project.core
Caused by: java.lang.ClassNotFoundException: project.core
I opened the jar with jd-gui
and I see that there's indeed no project.core
class even though the manifest mentions it.
Running a non-AOT variant with java -jar MyProject.jar -m project.core
works just fine.
Are there some obvious steps that I might have missed? Or can it be an issue with depstar
?Is your project on GitHub so I can take a look @p-himik?
Does your project.core
namespace have (:gen-class)
in the ns
form? Does it have a -main
function?
(if you create an app
project with clj-new
, it'll have all the right bits in it that you need for an uberjar -- it'll even have the :aliases
already set up in deps.edn
)