yazz.com
yazz.com

Reputation: 58786

Does Clojure require a JDK?

I want to distribute a Clojure program. Do I need a JDK or can a JRE handle everything in Clojure?

Upvotes: 13

Views: 3337

Answers (3)

vikbehal
vikbehal

Reputation: 1524

JRE is required! You can easily download it from Internet.

Upvotes: -3

justinhj
justinhj

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

Jeff Foster
Jeff Foster

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

Related Questions