Reputation: 58786
I want to distribute a Clojure program. Do I need a JDK or can a JRE handle everything in Clojure?
Upvotes: 13
Views: 3337
Reputation: 11306
You only need the user to have a JRE (v1.5 or above)
Clojure programs can be compiled into a jar file. You don't have to use something like leiningen, but it's a lot easier.
Check out this page on the Clojure.org site for how to compile and run a program.
You can compile to a jar file from the REPL:
(compile 'clojure.examples.hello)
Here's how you would run a compile jar:
java -cp ./classes:clojure.jar clojure.examples.instance asdf
Upvotes: 13
Reputation: 44706
You just need a JRE.
https://github.com/technomancy/leiningen/blob/master/TUTORIAL.md explains in more detail, but I believe you just want an "Uberjar" which will contain all the dependencies that you need to distribute your application.
Upvotes: 6