I am new to clojure and I have tried to compile it last night but I couldn't seem to do it and I have no idea. I am on windows and don't know much about java. I just want a stand-alone file that I can give to my friends. (I know they need java) Can anyone help?
The easiest way would be to use Leiningen. You can make a very simple project.clj file for your project with :main pointing to your main file's namespace, and then you could do 'lein uberjar' on the command-line and it would stick all your dependencies in a single executable jar file.
I'll point out that every file that needs to be compiled must have a namespace with :gen-class enabled. For example:
(ns whatever.main
(:gen-class))
How about an all in one Clojure installer for Windows? Unless I misunderstood your question and you want your Clojure files themselves compiled.
If you want to compile your own Clojure files, you can read this explanation on the Clojure site.
for producing a stand alone clojure program Leiningen's uberjar option does just that! Install leiningen and then run:
lein uberjar
and you get a single file that your friends can use to run your program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With