Leningin, uberjar and Exception in thread "main" java.lang.NoClassDefFoundError: ...
March 8, 2012
The bare minimum to get a leningin uberjar to run properly on the command line is:
- The namespace that contains -main method must have :gen-class applied like so:
1
2
(hello-world.core
(:gen-class))
-
The project.clj must have a :main setting that points to the namespace containing -main:
… :main hello-world.core …
Now both lein run and java -jar hello-world-1.0.0-SNAPSHOT-standalone.jar produce the output Hello world!. This project is on github as “hello world”.
Categories:
Clojure
Getting started ...